title: Javascript Execute After Page Render IE6
body: <p>I am having trouble with some JavaScript running before the page is completely rendered in IE 6 (maybe other versions too but just testing IE6 for now.  Firefox seems to be OK).  I can get around this by calling the js on <code>window.onload</code> like this:</p>
  
  <pre><code>window.onload = function(){doIt();}
  </code></pre>
  
  <p>However, my concern is the fact that I will overwrite anything else that may already be in <code>window.onload</code>.  The code will be used as part of a library so I can not guarantee that <code>window.onload</code> will not be set somewhere else by someone else.  I would rather append my function to the <code>onload</code> event like this:</p>
  
  <pre><code>window.onload += function(){doIt1();}
  window.onload += function(){doIt2();}
  </code></pre>
  
  <p>But when I do so, only <code>doit2()</code> is called.  Is there a way to register an event handler for when the page is fully rendered?  My second thought would be to just put my code in a loop checking to make sure all my objects exist before running.  But I am scared that this could potentially lockup the browser.</p>
  
  <p>Just for some background info, my code is hiding/showing iFrames.  I know that I can use the iFrame's <code>onload</code> attribute but I need all of the iFrames to be fully loaded before calling the code.</p>
  
  <p>Any thoughts from the community?  Thanks in advance for you input.</p>