We are using window.onload or body onload=”” to start performing some events as the page is loaded.
There are some down side to this method. First of all we have to wait for images. Next, what if you had a few scripts and had some code tied to window.onload? They would overwrite each other.
Mootools have created a solution for this. Mootools comes with a custom event that fire as soon as the DOM is ready. It is called DomReady.
Above code will fire the myFunction as soon as all of the HTML DOM is loaded but before images, other windows and other images are loaded at all.
Benefits of DomReady Event:
Avinash Zala is leading various projects which deals with the various technology involved with the web. A combination of perfect technical and management skills. Avinash would like to chat with you and convert your imagination into the working system. You can get in touch with him on Facebook and Twitter.
View all posts by: Avinash