title: How to set document.domain for a dynamically generated IFRAME?
body: <p>I am implementing CodeMirror (<a href="http://marijn.haverbeke.nl/codemirror/" rel="noreferrer">http://marijn.haverbeke.nl/codemirror/</a>) on a page where document.domain needs to be declared (because of other IFRAMES on the page).</p>
  
  <p>CodeMirror generates a dynamic IFRAME to provide syntax highlighted code editing. The problem is that IE throws up 'Access Denied' (other browsers are fine) at the following piece of code mirror code:</p>
  
  <pre><code>this.win = frame.contentWindow;
  ...
  var doc = this.win.document; &lt;-- ERROR
  doc.open();
  doc.write(html.join(""));
  doc.close();
  </code></pre>
  
  <p>It turns out IE doesn't inherit document.domain from parent IE. I can set document.domain in the IFRAME contents but IE throws up the error before I can even set the contents. Any ideas how to tackle this problem?</p>