title: Add multiple window.onload events
body: <p>In my ASP.NET User Control I'm adding some JavaScript to the <code>window.onload</code> event:</p>
  
  <pre><code>if (!Page.ClientScript.IsStartupScriptRegistered(this.GetType(), onloadScriptName))
    Page.ClientScript.RegisterStartupScript(this.GetType(), onloadScriptName, 
      "window.onload = function() {myFunction();};", true);            
  </code></pre>
  
  <p>My problem is, if there is already something in the <code>onload</code> event, than this overwrites it. How would I go about allowing two user controls to each execute JavaScript in the <code>onload</code> event?</p>
  
  <p><strong>Edit:</strong> Thanks for the info on third party libraries. I'll keep them in mind. </p>