JQuery Programmer Question: Download Questions PDF
Is there any difference between body onload() and document.ready() function?
![JQuery Programmer Interview Answer JQuery Programmer Interview Question](https://globalguideline.com/public/images/interview/23.png)
Answer:
document.ready() function is different from body onload() function for 2 reasons.
► We can have more than one document.ready() function in a page where we can have only one body onload function.
► document.ready() function is called as soon as DOM is loaded where body.onload() function is called when everything gets loaded on the page that includes DOM, images and all associated resources of the page.
► We can have more than one document.ready() function in a page where we can have only one body onload function.
► document.ready() function is called as soon as DOM is loaded where body.onload() function is called when everything gets loaded on the page that includes DOM, images and all associated resources of the page.
Download JQuery Programmer Interview Questions And Answers
PDF
Previous Question | Next Question |
How to set attributes of an element using jQuery? | What is the difference between parent() and parents() methods in jQuery? |