Delaying a jquery script until everything else has loaded

Solution 1:

You can have $(document).ready() multiple times in a page. The code gets run in the sequence in which it appears.

You can use the $(window).load() event for your code since this happens after the page is fully loaded and all the code in the various $(document).ready() handlers have finished running.

$(window).load(function(){
  //your code here
});

Solution 2:

This code block solve my problem,

<script type="text/javascript">
  $(window).bind("load", function () {
    // Code here
  });
</script>