[thelist] Waiting for a variable in an SCR script

Peter Small peter at genps.demon.co.uk
Mon Jan 14 05:01:20 CST 2002


I have a script in the body of an html page that is dependent upon a
variable that is assigned in an SRC script called from the header.

If the SRC is late in arriving, or gets blocked in some way, the script
doesn't run because the value is undefined.

How can I code for this contingency?

I can call a function in the body tag using the onLoad event to check for
"undefined" but then all I can do from this is to call a reload. This could
go on and on, continuously reloading (infuriating the receiver if the SRC
is blocked for a long time and there is no way for him or her to break the
repeated reload sequence).

Is there any way to hold up the loading of a page until a variable in an
SRC has been defined? Perhaps in a repeat loop that keeps checking the
value before allowing the page to appear (coming out of the repeat loop
with an alert if it is still undefined after a fixed period of time)?

Alternatively, can a series of reloads be terminated after a fixed period
of time?

Any suggestions or help would be much appreciated.

peter
http://www.avatarnets.com






More information about the thelist mailing list