What are the differences between the following.
$(window).load(function(){...});
$(document).ready(function(){...});
document.ready occurs when the document itself is done loading, window.load happens when all the assets are loaded.
The document ready event executes already when the HTML-Document is loaded and the DOM is ready, even if all the graphics haven’t loaded yet. If you want to hook up your events for certain elements before the window loads, then $(document).ready is the right place.
The window load event executes a bit later when the complete page is fully loaded, including all frames, objects and images. Therefore functions which concern images or other page contents should be placed in the load event for the window or the content tag itself
load is called when all assets are done loading, including images. ready is fired when the DOM is ready for interaction.