Both functions are used to perform tasks when the page is loaded in the browser but they have important differences. Most importantly, “window.onload” will execute code when browser has loaded the DOM tree and all other resources like images, objects, etc, while onDocumentReady allows you to execute code when only the DOM tree has been [...]
Posts Tagged ‘Javascript HTML’
What is the main difference between window.onload and onDocumentReady?
Posted: October 5, 2011 in FAQ, HTML, Java Script, Web DeveloperTags: Javascript HTML
0
