title: Proper way to add onload function to body using jQuery
body: <p>On one of my previous pages I use </p>
  
  <pre><code> &lt;script src="/js/wireEvent.js"&gt;&lt;/script&gt; 
  &lt;body onload="wireEvent();" &gt;
  </code></pre>
  
  <p>Basically, wireEvent() displays an image on top of the page whenever the mouse goes out of the browser.
  However, now I cannot add this function directly to the body of my page, so what is the proper way to add it? Will it be right if I add</p>
  
  <pre><code>&lt;script&gt;
   window.onload = wireEvent;
  &lt;/script&gt; 
  </code></pre>
  
  <p>or I enclose the whole function in </p>
  
  <pre><code> $( document ).ready 
  </code></pre>
  
  <p>and only include the function's file to my html? </p>