title: Should making two calls to window.onload be valid?
body: <p>I have two blocks of JavaScript which both call functions via <code>winodow.onload</code>.  One of the functions is called on every page, but the other is only called on one specific page.  On that page one function works, but the other does not, and I am not getting any errors that I can see.</p>
  
  <p>Does it matter that both functions are called via <code>window.onload</code> in different script blocks (see example)?  Shouldn't this work?</p>
  
  <pre><code>&lt;!--some html--&gt;
  
  &lt;script language="JavaScript" type="text/javascript"&gt;
      function firstFunction(){
          //do stuff
      }
      window.onload = firstFunction;
  &lt;/script&gt;
  
  &lt;!--some html--&gt;
  
  &lt;script language="JavaScript" type="text/javascript"&gt;
      function secondFunction(){
          //do stuff
      }
      window.onload = secondFunction;
  &lt;/script&gt;
  
  &lt;!--some html--&gt;
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I ended up taking zzzzBov's suggestion of using jQuery's <code>$(document).ready(doAction);</code> function.  Now I have multiple<code>.js</code> included on a single page all using this call and there is no conflict.</p>