Hi !
You can try this approach.
in script tag give it ID.
<SCRIPT ID=MyScript>
Then you can treat it as an object so later on it the code you can check for
its status
if its loaded or still loading.
You can get more info from here :
http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/readyst
ate_1.asp
and
http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/script.asp
Oleg.
-----Original Message-----
From: speedguru@m... [mailto:speedguru@m...]
Sent: April 17, 2002 8:30 AM
To: javascript
Subject: [javascript] abort a long js gracefully if it fails to load
completely
hi,
i'm building a v.long (may reach over 500 lines) dynamic javascript string
. The javascript string is dynamically created with ASP using values from
SQL Server. This works fine but with a slow Internet Connection, the script
timesout and spews an ugly javascript error bcos the code has not completely
downloaded and some element of the form does not get the supporting code or
function it is looking for.
Now how can i abort gracefully ? If the whole code does not load..i want to
show a friendly message asking the user to retry later or reload and
gracefully end the program.
i've thought of using settimeout to forcibly end the program if it does not
load completely in a specified amount of time but i was wondering if there
was a way for the script to take its own course and fail gracefully if the
entire script doesn't load
Moreover, this particular script in which i'm using an external javascript
works fine in Netscape 4.04 but fails in Netscape 4.7. It shows "contacting
<server>" or "reading file......." and just hangs. i forcibly have to
terminate it using Task Manager. (i'm working on a win2k machine & i'm
running the data-driven asp page from a IIS5 webserver )
tfyt
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20