Run JavaScript only after page is completely loaded
jQuery document.ready() gets called immediately after DOM elements are loaded but window.onload() which is Javascript event gets called when page is completely loaded. Read "Is window.onload is different from document.ready()"
So sometimes you may encounter a situation where you need to run the Javascript code once your page is loaded completely. So how do you achieve that? Well, the solutions is combination of jQuery and JavaScript. The solution is to bind the window.onload event in document.ready().
$(window).bind("load", function() { // code here });
Feel free to contact me for any help related to jQuery, I will gladly help you.