title: Firefox not detecting iframe load event?
body: <p>There's an ad unit on my page which is simply an iframe.  When the page loads, there are a couple of different ads that can be displayed within the iframe.  There's a piece of javascript within the iframe that attempts to render the first ad unit with the following method:</p>
  
  <pre><code>document.open();
  document.write(ad_tag1);
  document.close();
  </code></pre>
  
  <p>The first ad unit will render an ad with some probability or else it will fire a postmessage event to the ad unit iframe indicating there's no ad to show.</p>
  
  <p>If there's an ad to show, everything's golden.  However, if there's not, the ad unit will proceed to do:</p>
  
  <pre><code>document.open();
  document.write(ad_tag2);
  document.close();
  </code></pre>
  
  <p>This causes the second ad tag to render just fine.  However, the problem is that Firefox seemingly can't detect when the second ad unit has loaded even though it clearly has and the spinner at the top of the page keeps spinning forever as if there's still stuff to load.</p>
  
  <p>I have also tried using DOM manipulation methods such as innerHTML, but that produced the same problem.  I also tried using Prototype JS's built-in update method, but that also caused the same problems.</p>
  
  <p>Anyone have any ideas why Firefox is doing this?  My code works perfectly on chrome..</p>
  
  <p>Also, I have no control of what the ad tags are.  The ad tags are third party and may as well be black boxes from my point of view as in the ad tags may contain scripts, may drop an iframe, etc.</p>