Is there any difference between body onload() and document.ready() function?



Is there any difference between body onload() and document.ready() function?..

Answer / chaitanya

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.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

Do we need to add the jquery file both at the master page and content page as well?

0 Answers  


What is jquery toggle function?

0 Answers  


How to check or uncheck all checkboxes using jquery?

0 Answers  


Do you know what is the use of jquery.data()?

0 Answers  


What are features of jquery or what can be done using jquery?

0 Answers  






Define data paremeter of jquery ajax method?

0 Answers  


How to find grand children in of an element?

0 Answers  


Explain cdn in jquery?

0 Answers  


How to load jQuery locally when CDN fails?

1 Answers  


What is .empty()? : jquery mobile

0 Answers  


What are the types of selectors in jQuery?

0 Answers  


Which operating system is more compatible with jQuery?

0 Answers  


Categories