Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Removing On-Demand Script Elements

6 views
Skip to first unread message

Server Herder

unread,
Oct 7, 2009, 3:27:28 PM10/7/09
to

(I apologize upfront if this is not the right group)

Hello,
When using the <a href="http://ajaxpatterns.org/On-Demand_Javascript">
On-demand Script Pattern</a> it is often helpful to abort retrieval of
a remote script if it is taking longer than a given time. An example
of this might be an application that periodically updates a page by
attaching a script element. If the script has not returned within the
update interval, any data returned by the script would be considered
"stale" and only the new data would be needed.

In IE and WebKit, this can be accomplished by removing the script
element from the DOM. Moreover, creating and attaching a new script
element without removing the first will not be blocked. This,
however, does not appear to be the case in FireFox. Since Firefox
seems to guarantee execution order will match insertion order, the
first script must hit the network timeout before any subsequent
scripts can be executed.

Is there a way to specify the timeout period or to abort retrieval
(and the ensuing blocking) from occurring so other scripts (that may
have all ready finished downloading) can continue to execute?

Thanks,
Will

0 new messages