4 ms·
AFAIK, `defer` only works in IE, and `async` only works in: IE10p2+, Chrome 11+, Safari 5+, Firefox 3.6+ So some browsers would be left out, right?
by padolsey 15y ago
AFAIK, `defer` only works in IE, and `async` only works in: IE10p2+, Chrome 11+, Safari 5+, Firefox 3.6+
So some browsers would be left out, right?
- JoshTriplett 15y agoThat list represents most of the browsers people care about, with the exception of old IE. And "better with a modern browser, manages to function on old IE" seems like the right standard to shoot for most of the time, depending on your site's audience.
- pornel 15y agoThe pattern Async Analytics uses works in all browsers and it's simple enough that you don't need a library for it: var script = document.createElement('script'); script.async = true; // enables out of order execution script.src = '…' var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(script, s); http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html http://code.google.com/apis/analytics/docs/tracking/asyncTra...