What is the difference between $(window).load and $(document).ready?



What is the difference between $(window).load and $(document).ready?..

Answer / Avinash Shahi

`$(document).ready()` executes as soon as the Document Object Model (DOM) is ready for manipulation, while `$(window).load()` waits for all elements (including images, scripts etc.) to be fully loaded. In most cases, `$(document).ready()` should be used instead of `$(window).load()`, as it is faster.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

Do we need to add jQuery file in both Master and Content page?

1 Answers  


Explain the difference between event.preventdefault and "return false"? : jquery mobile

1 Answers  


What are the advantages of minified version of jquery?

1 Answers  


Whether we need to add jQuery file in both Master and Content page?

1 Answers  


Which is the fastest selector in jQuery?

1 Answers  


With jquery ui 1.7 being released in the last few days, what do you see as the key parts of jquery ui 1.7? What are you most proud of out of that release?

1 Answers  


Change the url for a hyperlink using jquery?

1 Answers  


How can related code be encapsulated? Give example.

1 Answers  


Tell me how to check data type of any variable in jquery? : jquery mobile

1 Answers  


Please explain remove class jquery with example?

1 Answers  


Explain .bind() vs .live() vs .delegate() vs .on()

2 Answers  


Is it too early to discuss jquery ui 1.8?

1 Answers  


Categories