4 ms·
Most scripts need access to the DOM, and waiting for the onload or domcontentloaded events ensure that the DOM has properly loaded when you run your script. Usi
by EmilStenstrom 16y ago
Most scripts need access to the DOM, and waiting for the onload or domcontentloaded events ensure that the DOM has properly loaded when you run your script. Using setTimeout does not ensure that, so you can't really write a script tag then...