The main differences between the two are:
- Body.Onload() event will be called only after the DOM and associated resources like images got loaded.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.
Do you want to hire us for your Project Work? Then Contact US.