What is the difference between window.onload, document.onready and body.onload ?
What is the difference between window.onload , document.onready and body.onload ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
window.onloadwill wait until all assets have finished downloading, such as images and scripts.DOM ready waits until you can access the DOM via the API.
As a side note, in this day and age, you ought to be using
window.addEventListener('load', function() { }, false)orattachEvent()for older IEs.