title: Cross domain access permission denied in iframe
body: <p>I am trying to embed OWA (Microsoft Exchange Server 2010) in a web page within an <code>iframe</code> but I get a JavaScript error on the OWA page saying Access Denied and then none of the controls within the OWA window work.</p>
  
  <p>I have to use OWA in web page, I read in the form that cross domain does not work properly. Error comes as:</p>
  
  <blockquote>
    <h2>Client Information</h2>
    
    <p><strong>User Agent:</strong> Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.11) Gecko/20101012 Firefox/3.6.11 GTB7.1 (.NET CLR 3.5.30729)<br>
    <strong>CPU Class:</strong> <code>undefined</code><br>
    <strong>Platform:</strong> Win32<br>
    <strong>System Language:</strong> <code>undefined</code><br>
    <strong>User Language:</strong> <code>en-US</code><br>
    <strong>CookieEnabled:</strong> true</p>
    
    <h2>Exception Details</h2>
    
    <p><strong>Date:</strong> Wed Oct 27 2010 10:17:05 GMT+0530 (India Standard Time)<br>
    <strong>Message:</strong> Permission denied for <code>&lt;http://domain_2&gt;</code> to get property <code>HTMLIFrameElement.ownerDocument</code> from <code>&lt;domain_1&gt;</code>.<br>
    <strong>Url:</strong> <code>http://domain_2/owa/testuser@exch2k10.com/14.0.639.21/scripts/premium/uglobal.js</code><br>
    <strong>Line:</strong> 1</p>
    
    <h2>Call Stack</h2>
  
  <pre><code>undefinedError()@:0 window$onerror(&amp;quot;Permission denied for &lt;http://domain_2&gt; to get property HTMLIFrameElement.ownerDocument from &lt;domain_1&gt;.&amp;quot;,&amp;quot;http://domain_2/owa/testuser@exch2k10.com/14.0.639.21/scripts/premium/uglobal.js&amp;quot;,1)@http://domain_2/owa/testuser@exch2k10.com/14.0.639.21/scripts/premium/uglobal.js:1 (domain_1&gt;.&amp;quot;,&amp;quot;http://domain_2/owa/testuser@exch2k10.com/14.0.639.21/scripts/premium/uglobal.js&amp;quot;,1%29@http://domain_2/owa/testuser@exch2k10.com/14.0.639.21/scripts/premium/uglobal.js:1) function Array$get_Length() { return this.length; } function Array$get_Item(index) { return this[index]; } function Array$get_Enumerator() { return new (Owa.Collections.ListEnumerator)(this); } function Array$remove(oItem) { var index = this.indexOf(oItem); if (index &gt; -1) { this.splice(index, 1); } return index &gt; -1; } function Array$removeAt(iIndex) { if (iIndex &lt; this.length) { this.splice(iIndex, 1); return true; } return false; } function Array$add(oItem) { this.push(oItem); } function Array$clone() {
  </code></pre>
  </blockquote>
  
  <p>What I saw is that the error comes when <code>uglobal.js</code> which comes with the Exchange in the <code>iframe</code> trying to access property of <code>parent</code>.  </p>
  
  <blockquote>
    <p><strong>Message:</strong> Permission denied for <code>&lt;http://domain_2&gt;</code> to get property HTMLIFrameElement.ownerDocument from <code>&lt;domain_1&gt;</code>.</p>
  </blockquote>
  
  <p>Is there any other way by which I can use OWA in my page?</p>