PDA

View Full Version : window.onload : IE5 windows


Garrett Smith
29.05.2001, 20:52
I use this for preloading images. It is in an external js file.
It works fine in Mac IE and NS6. Are there any problems in windows IE?

function checkfirst(e){
if(document.readyState)
if(document.readyState == "complete")
loadMenu();
else setTimeout('checkfirst()',500);

else if(addEventListener)
window.addEventListener("load", loadMenu, false);
else loadMenu();
}
this.onload=checkfirst();




"Hello world"

Garrett Smith
30.05.2001, 14:53
As I suspected, IE5/Win had a problem with this. I don't know why, since it works fine in Mac IE and NS6. I guess it might have to do with the () in onload=checkfirst(). Unfortunately, it's the only way to make it work in NS6 and IE5.

Garrett

For test purposes, you can make loadMenu a dummy function and put it below the onload=checkfirst().

funcion loadMenu(){
alert("loading menu...")
}

Garrett Smith
02.06.2001, 17:02
From what I can tell, the following is what happens on win IE5/5.5.
The window.onload calls checkfirst(), checkfirst runs once (it is recursive), then produces the error "Not implemented", then continues to run. Since the only known side effect is an error message, I left it as is.


"Hello world"