3 ms·
I've thought to myself, "I wish there was a timeout attribute on the <script> tag," about once every few months for the past 10 years. Is there any good reason
by sounddust 16y ago
I've thought to myself, "I wish there was a timeout attribute on the <script> tag," about once every few months for the past 10 years. Is there any good reason you can't manually specify how long you want the browser to wait for an external file to load?
- blasdel 16y agoYou can at least control the degree of blocking in the latest Webkit: http://webkit.org/blog/1395/running-scripts-in-webkit/ http://webkit.org/blog/1395/running-scripts-in-webkit/
- eli 16y agoI believe FFox 3.6 supports async attribute as well
- stellar678 16y agoThere's no reason you couldn't code this up in JavaScript: load jquery from google - onload, set flag jquery_loaded settimeout load_locally_if_not_flag 5sec
- toolate 16y agoDon't forget that JavaScript is blocking. You'd need to load the jQuery from Google dynamically by inserting script tags. By the time you've added that, timeouts and fallbacks the amount of inline JS would make hosting jQuery on a CDN pointless.