back

by padolsey·15y ago·view on hn ↗
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?

2 comments
That 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.
The 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/asyncTra...