Skip to content

24 ways to impress your friends

Vote down?

Kabari Hendrick

I think some of you missed the finer points of this article. Look at Problem: the load event carefully. The difference is that you are not waiting to check if the @Window@ has loaded before you fire your script. Using @document.write@ will print your simple CSS immediately to the page, thus hiding your elements whereas using any javascript functions like @getElementsByID@ etc. will not fire until the html content of the html on the page is already loaded, even if you use them in the same way. It’s as simple as this, @document.write@ doesn’t need any html to work, alll the other functions can’t work until the html exists.