Re:Why loading third party scripts async is not good enough
by bobds on Wednesday November 23, 2011 @10:40AM
(#3270348)
If a script is supposed to run when the DOM is ready but external scripts/stylesheets/etc are still being loaded, it should not attach itself to the load event. The load event is supposed to run when the page has fully loaded. By the way, IE9 now supports DOMContentLoaded and there are hacks to simulate it in earlier IE versions.
Here is a demonstration: http://ie.microsoft.com/testdrive/HTML5/DOMContentLoaded/Def...
Without this code, the animation would wait until facebook, google + and twitter are all loaded, but with this code, the animation would start right away.