Jick
07-12-2003, 02:18 AM
Ok, here we go! I have this page pre-load script working here:
http://kd7pyo.infinitypages.com/
If you look in the source file you will see that it has three parts:
1. The onload="loadImages()" event in the body tag.
2. The id="hidepage" div thats on the line below it.
3. <SCRIPT LANGUAGE="JavaScript" src="preload.js"></script> in the head tag.
Here is what is in the external js file:
<!-- Begin
function loadImages() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('hidepage').style.visibility = 'hidden';
}
else {
if (document.layers) { // Netscape 4
document.hidepage.visibility = 'hidden';
}
else { // IE 4
document.all.hidepage.style.visibility = 'hidden';
}
}
}
// End -->
I want to convert the stuff in the external js file to a javascript that I can put in the head tag of the same page and have the div and onload link to that instead of the js file. I tried it once already but I didn't get it to work. Can someone help me please? Thank you.
http://kd7pyo.infinitypages.com/
If you look in the source file you will see that it has three parts:
1. The onload="loadImages()" event in the body tag.
2. The id="hidepage" div thats on the line below it.
3. <SCRIPT LANGUAGE="JavaScript" src="preload.js"></script> in the head tag.
Here is what is in the external js file:
<!-- Begin
function loadImages() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('hidepage').style.visibility = 'hidden';
}
else {
if (document.layers) { // Netscape 4
document.hidepage.visibility = 'hidden';
}
else { // IE 4
document.all.hidepage.style.visibility = 'hidden';
}
}
}
// End -->
I want to convert the stuff in the external js file to a javascript that I can put in the head tag of the same page and have the div and onload link to that instead of the js file. I tried it once already but I didn't get it to work. Can someone help me please? Thank you.