Hi, friends
I want to know that how the body of onload() function is different from document.ready() function used in jQuery?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Nov 28, 2011, 10:07 PM
- 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