$(window).ready(function () { code example
Example: jquery on window ready
// A $( document ).ready() block.
$( document ).ready(function() {
console.log( "ready!" );
});
// A $( document ).ready() block.
$( document ).ready(function() {
console.log( "ready!" );
});