title: Calling a JavaScript function before body tag
body: <p>I have Load() function in an external file called <em>cookieRedirect.js</em> and I want to load that function before the &lt;body&gt; tag.</p>
  <p>I used to load it like this:</p>
  <pre><code>    &lt;script type=&quot;text/javascript&quot; src=&quot;cookieRedirect.js&quot;&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body onload=Load();&gt;
  </code></pre>
  <p>But when I try this, it's not working:</p>
  <pre><code>    &lt;script type=&quot;text/javascript&quot; src=&quot;cookieRedirect.js&quot;&gt;
          window.onload = Load();
      &lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  </code></pre>