What is the difference between window.onload and onDocumentReady?
Submitted by: Administrator► 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.
Submitted by:
► 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.
Submitted by:
Read Online Expert Developer JavaScript Job Interview Questions And Answers
Top Expert Developer JavaScript Questions
☺ | Mention what is the disadvantage of using innerHTML in JavaScript? |
☺ | Which keyword is used to print the text in the screen? |
☺ | Why it is not advised to use innerHTML in JavaScript? |
☺ | Explain the concept of unobtrusive JavaScript? |
☺ | How are JavaScript and ECMA Script related? |
Top Scripting language Categories
☺ | AngularJS Interview Questions. |
☺ | Ext-JS Interview Questions. |
☺ | Dojo Interview Questions. |
☺ | Expert Developer JavaScript Interview Questions. |
☺ | jQuery Mobile Interview Questions. |