3 ms·
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.
by bobds 15y ago
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/Default.html http://ie.microsoft.com/testdrive/HTML5/DOMContentLoaded/Def...