In jQuery we start the jquery code with $(document).ready(function({})); or $(window).load(function({})); both are correct but work process of that code will be different. What’s the difference in this two.
$(document).ready(function({}));
The jQuery code started with this one mean's it will executes when HTML-Document is loaded and DOM is ready.
$(window).load(function({}));
The jQuery code started with this one mean's it will executes when complete page is fully loaded, including all frames, objects and images. If you open the web it will load the web page by hierarchically manner it will execute the everything in the web page load afterwards it will execute this jQuery function.