"-@-" wrote:
Hi there All,
Don't know if this is possible at all, but here goes.
I've got a page (an active server page if that makes any difference), that
is pulling some sticky content from www.freesticky.com using the following
code:
<script type="text/JavaScript"
src="http://www.freesticky.com/stickyweb/syndicate/otd_events_hlines.asp"></
script>
The problem is that occasionally www.freesticky.com is unavailable, and so
is the stuff I'm trying to display. This in turn causes my page to hang.
Is it possible to set some kind of timeout, or something that will allow my
page to complete loading even if this stuff is not available.
Any help you could offer would be major cool.
Thanks,
@ndyB
You can try setting DEFER on the <SCRIPT> tag:
<url:
http://msdn.microsoft.com/workshop/a...ties/defer.asp
/>
However, be aware that even if it works in a browser [1], it may produce other
errors if code in your own page relies on code that is defined in the file you
are sourcing for the script tag. I believe there's more to the use of DEFER, I
seem to recall some discussion about it here in the recent past, you might find
more information at <url:
http://groups.google.com/groups?q=sc...sa=G&scoring=d
/>.
Also, there's no guarantee it will prevent the browser from stalling if the host
from which the SRC is being loaded is unavailable, although it probably should.
[1] note what it says at <url:
http://www.w3.org/TR/REC-html40/interact/scripts.html />
defer [CI]: When set, this boolean attribute provides a hint to the user agent
that the script is not going to generate any document content (e.g., no
"document.write" in javascript) and thus, the user agent can continue parsing
and rendering.
The operative words in that explanation are "hint to the user agent".
--
| Grant Wagner <gw*****@agricoreunited.com>
* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
*
http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
*
http://www.mozilla.org/docs/web-deve...upgrade_2.html