Steve said the following on 10/11/2007 10:00 AM:
How can I let my script try to load a .js file and then if the .js
file doesn't load in a selected time period print an apology move on
with the rest of the page.
For instance I am using this line but sometimes the http site is down
and then my page doesn't load.
<script src="http://xxxx.com/frame.js"></script>
Put a variable in the frame.js file and then use setTimeout to see if
that variable exists or not. The problem would come in with IE. In IE,
if frame.js doesn't load (for whatever reason), then it loads a 404
error page instead and will throw an "Illegal Character" error message.
Once you have made the request for the file, the only reliable way to
end the request for that file is to navigate away or reload the page and
start over.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -
http://jibbering.com/faq/index.html
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/