Head JS Loads JavaScript Files Like Images Without Blocking the Page
headjs.com
headjs.com
http://news.ycombinator.com/item?id=2780233
And this does the same thing without using proprietary code:
<script defer async src="blah"></script>
(and head.js won't do anything special in browsers where the above line isn't supported anyway)So some browsers would be left out, right?
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...I have successfully used LABjs (labjs.com), it has more fine-grained control over parallel/serial loading and execution. For a single project. One of the goals was to parallelize script loading, but modern browsers already do that, they will load up to 4 js files in parallel and execute them in order. In the end the performance gain does not justify the added complexity.
but I wouldn't bother with any of them. IMHO concatenated scripts at end of <body> are just fine.