$(document).ready(function(){
// ...
});
This itself states that is a function to be called when the DOM (document) is ready to be rendered. This does not wait for content / page to be loaded. In order to run a function after window / page content is loaded, you need to use $(window).load(function(){});
document ready function can be written multiple times with various functions or executions inside it, However, window load function can only be written once.