title: Cannot set document.body.innerHTML of IFrame in Firefox
body: <p>I've looked for a cross-browser way to programmatically set the innerHTML of an IFrame.  (As in <a href="http://roneiv.wordpress.com/2008/01/18/get-the-content-of-an-iframe-in-javascript-crossbrowser-solution-for-both-ie-and-firefox/" rel="noreferrer">http://roneiv.wordpress.com/2008/01/18/get-the-content-of-an-iframe-in-javascript-crossbrowser-solution-for-both-ie-and-firefox/</a>).  I've written some sample code (below), and  I can get it to work in Safari and Chrome, but not Firefox.  Can anyone help me figure out what I need to do instead (in a portable way)?</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  
  &lt;div name=FRAME2div id=FRAME2div style="position:absolute; background-color:blue; color:black; border-color:black;border-width:0; left:100px; top:40px; width:200px; height:200px; overflow:scroll; display:block; " &gt;
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  document.getElementById("FRAME2div").innerHTML = '&lt;iframe border=0 id=IFRAME2 name=IFRAME2 &gt;&lt;/iframe&gt;';
  document.getElementById("IFRAME2").contentWindow.document.body.innerHTML = '&lt;html&gt;&lt;body&gt;&lt;p&gt;NETSCAPE&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;';
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>