I am dynamically adding script tags to the DOM so I can download JSON data. Occasionally something goes wrong with a download, and the script fails to load properly.
How do I tell the browser to give up on a script that has taken too long to load? I think this is important because the browser limits the number of open requests at one time, and I don’t want to waste it with dead connections.
I tried removing the script tag from the DOM, but that seems to have no effect.
I’m not sure that you can control how the browser loads a script once you’ve inserted it into the DOM.
However, if you use an XMLHttpRequest to download the JSON data, you can call the
abortmethod if the request takes too long.Steve