The difference is that onDocumentReady is called after the DOM is loaded without waiting for all the contents to get loaded. While window.onload() function waits until the contents of page is loaded.Suppose there is very large image on a page, at that time onDocumentReady will wait until that image is loaded totally.So while using the window.onlaod() function the execution will be slow, but the onDocumentReady will not wait until the image is loaded.
Javascript
Topic: JS Window
What is difference between window.onload and onDocumentReady?
Browse random answers:
What is a Window Object?
To put a "close window" link on a page ?
Can you explain about Screen object?
How to get height and width of different browser in Javascript?
What is difference between window.onload and onDocumentReady?
How to determine the state of a checkbox using Javascript?
How to get the contents of an input box using Javascript?
What is other equivalent option of document.getElementById() when you are working with Ajax?
How to toggle display an HTML element?
How to get the Scroll height and Width in JavaScript !!
How can you set position of the page (Top and Left) to 0 using Javascript in one line code?
Basic methods for opening a PopUp window using Javascript?
What is the difference of "setTimeout" function and setInterval functions in Javascript
How do you submit a form using Javascript ?
Explain with an example the use of event handlers in JavaScript.
How to open a window with no toolbar, but with the location object.
How to reload the current page
Difference between window.onload and onDocumentReady?