Hi, friends
I want to know that how the body of onload() function is different from document.ready() function used in jQuery?
Onload and ready function in jQuery
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Nov 28, 2011, 5:07 PM EST
- Body.Onload() event will be called only after the DOM and associated resources like images got loaded, but jQuery's document.ready() event will be called once the DOM is loaded i.e., it wont wait for the resources like images to get loaded. Hence, the functions in jQuery's ready event will get executed once the HTML structure is loaded without waiting for the resources.
- We can have multiple document.ready() in a page but Body.Onload() event cannot.
Referhttp://beyondrelational.com/blogs/hima/archive/2011/02/09/does-document-ready-function-similar-to-onload-or-explain-the-importance-of-document-ready.aspx
Thanks