CODEDIGEST InstallShield
Home Articles CodeDigest Tutorials InstallShield FAQs
Skip Navigation LinksHome » FAQs » What is the difference between Body.OnLoad and jQuery document.ready() Event?   You are not logged in.
Search
 

Sponsors
InstallShield
 

Technologies
 

CodeDigest Navigation
 

Technology News
No News Feeds available at this time.
 

Community News
No News Feeds available at this time.
 
What is the difference between Body.OnLoad and jQuery document.ready() Event?
What is the difference between Body.OnLoad and jQuery document.ready() Event?
Submitted By Satheesh Babu
On 7/28/2009 8:09:00 AM
Tags: Interview Questions,jQuery,javascript  

What is the difference between Body.OnLoad and jQuery document.ready() Event?

 The main differences between the two are:

  1. 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.
  2. We can have multiple document.ready() in a page but Body.Onload() event cannot.