title: How to get javascript in one frame to wait until a page has loaded in a second frame
body: <p>I have two frames in a frameset - <code>frame[0]</code> contains a script that loads a page into <code>frame[1]</code> using </p>
  
  <pre><code>top.frames[1].location.href = 'http://some_location.com/page.html';
  </code></pre>
  
  <p>and then performs actions on that page, for example searching text within the page. I need the script to wait until <code>page.html</code> has loaded in the second frame before doing this, and I can't use <code>onload=...</code> in the second page because I have no control over its source.</p>
  
  <p>Is there a way to do this?</p>