[thelist] Problems with late arrivals of JS SRCs

Peter Small peter at genps.demon.co.uk
Wed Jan 9 07:56:45 CST 2002


It is a useful line of thought Simon.

I could set a different variable in each SRC module and keep checking to
see if all the variables have been set (tellling me all the SRCs have
arrived).

However, would this tie up the processor so that it couldn't set the
variables while in this repeat loop?

peter
http://www.avatarnets.com



>in IE 4 and up there is a read-only property of the document object called
>"readyState" which holds real time updated info on the loading state of the
>page.
>
>it can hold one of the following values:
>complete - page finished loading completely
>interactive - something to do with being able to interact with some of the
>page's loaded objects, but it's not finished loading them all yet
>loading - hmmm... ? :)
>uninitialized - i guess this is an error code of some sort
>
>if you pole this periodically, you can test whether the page has completely
>loaded
>
>use something like..
><body onload="checkLoaded()">
>blah...
></body>
>
>then in the first js listed in the header put
>
>var nTimerID;
>
>function checkLoaded()
>{
>	if(document.readyState != "complete")
>		nTimerID = setTimeout("checkLoaded()", 100);	// waits
>1/10th of a second
>then calls the function again
>	else
>		doTheNextThing();	// call whatever needs to be called
>next
>}
>
>or, you could just put all your JS into one file ;-)
>
>i'm sure none of this code will be useful, and you probably want it to work
>in Netscape/Mozilla/Opera as well...
>
>good luck
>simon
>
>
>--
>For unsubscribe and other options, including
>the Tip Harvester and archive of TheList go to:
>http://lists.evolt.org Workers of the Web, evolt !







More information about the thelist mailing list