document.ready vs window.load

document.ready is firedĀ once the html has loaded while windows.load is fired once everything has loaded including images, jquery, html, text from db etc.

Therefore the document.ready would fire before the window.load



$(document).ready(function() {

//your code here – fired when html loads


$(window).load(function() {

//your code here – fired when all page elemenets are loaded