top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is Difference between $(document).ready() vs window.onload()?

0 votes
What is Difference between $(document).ready() vs window.onload()?
posted Jan 17, 2018 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote


jQuery document.ready will execute our code when the HTML is all ready, but before images and other resources have finished.

//write your code here;



window.onload() runs after everything has finished loading including images and scripts, but usually not stylesheets. Use this for code when page wouldn't change anymore.

window.onload = function() {

Hopefully this will help you. Thanks.

answer Feb 24, 2018 by Vishi Gulati