title: IE9 "Access is Denied" Error, When Accessing IFrame
body: <p>I have an html page (<code>test.html</code>) on my computer (localhost). In an iframe on that page I have <code>abc.example.com</code> loaded.</p>
  
  <p>I want to access the contents of the iframe <code>abc.example.com</code> from another domain <code>xyz.example.com</code>. Here is what I've tried so far:</p>
  
  <pre><code>//test.html in abc.example.com
  &lt;input type="textbox" /&gt;
  &lt;input type="submit" value="click_me" /&gt;
  
  //Start.html in xyz.example.com
  
  &lt;script type="text/javascript"&gt;
    $(document).ready(function() {
  
      $("#ok").click(function() {
        //using javascript
        var oo = document.getElementById("myFrame");
  
        document.getElementById("divFrame").innerHTML = 
          oo.contentWindow.document.body.innerHTML;   
      });
  
    });
  &lt;/script&gt;
  
  &lt;iframe id="myFrame" src="http://localhost/exam/test.html"&gt;&lt;/iframe&gt;
  &lt;div id="divFrame"&gt;&lt;/div&gt;
  &lt;input type="submit" id="ok" /&gt;
  </code></pre>
  
  <p>But when I press the "ok" button, it throws an <code>"Access is Denied"</code> error. I also get the same error when using jQuery to simulate clicks in the iframe:</p>
  
  <pre><code>var btn = window.frames[0].document.getElementsByName('click_me');
  btn[0].click();
  </code></pre>