title: What is the difference between $window.load and window.onload?
body: <p>This might be a rookie question, but I have searched and tried a lot. What the is difference between <code>window.onload</code> and <code>$window.load</code>?</p>
  
  <p>There are great answers about the difference between <a href="https://stackoverflow.com/questions/4584373/difference-between-window-loadfunction-and-document-readyfunction">window.onload and document.ready</a> and <a href="https://stackoverflow.com/questions/588040/window-onload-vs-document-onload?lq=1">document.onload vs window.onload</a> etc, but I have not found a resource or article that mentions both <code>.onload</code> and <code>.load</code>.</p>
  
  <p><a href="https://api.jquery.com/load-event/" rel="noreferrer">jQuery documentation</a> says that .load is</p>
  
  <blockquote>
    <p>"This method is a shortcut for .on( "load", handler )."</p>
  </blockquote>
  
  <p>I tried putting both <code>window.onload</code> and <code>window.load</code> on the page and seeing which gets hit first or if they both get hit but they seem to interfere with each other. </p>
  
  <pre><code>(window).onload(function(){
          alert("window onload - executes when the window's load event fires.");
  }
  
  $(document).ready(function(){
          alert("document is ready - executes when HTML-Document is loaded and DOM is ready");
  }
  
  $(window).load(function(){
          alert("window is loaded - executes when complete page is fully loaded, including all frames, objects and images");
  }
  </code></pre>
  
  <p>What are the differences between them and why would you use one over the other? </p>