top of page

Jquery

Public·1 member

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

$(window).load()

The code which gets included inside $( window ).on( "load", function() { ... }) runs only once the entire page is ready (not only DOM).


$(document).ready()

The ready() method is used to make a function available after the document is loaded. Whatever code you write inside the $( document ).ready() method will run once the page DOM is ready to execute JavaScript code.

7 Views
bottom of page