JavaScript access parent window from popup windows
<p>I am trying to code this for hours and still couldn't do it. It keep tell me "Permission Denied".</p>

<p>Here is what I am trying to accomplish. This pretty hard to explain please follow the example below.</p>

<p>For example. domain111.com and domain222.com.
When I am on domain111.com i click on the popup link , it will pop-up the domain111.com/popup.html then  it redirect me to domain222.com. On this domain222.com it will redirect to couple pages before it redirect back to domain111.com with the result. I want to send the result from domain111.com to domain111.com.</p>

<p>The process is like below.
Domain111-popup to-->Domain111-redirect-->Domain222-redirect xxx Domain222 pages then redirect  to-->-Domain111---SEND to parent window->Domain11</p>

<p>Here is my code.</p>

<p>File name 1.hml on <strong>domain111.com</strong> </p>

<pre><code>&lt;script type="text/javascript"&gt;
    function IamParent() {
        alert('I am the parent of this window')
    }
    function PopUP() {
        window.open("http://domain222.com/2.htm", 'ALpop').focus();
    }

&lt;/script&gt;
&lt;body&gt;
    &lt;a href="#void(0);" onclick="PopUP();" &gt;Click&lt;/a&gt;
&lt;/body&gt;
</code></pre>

<p>File name 2.html on <strong>domain222.com</strong></p>

<pre><code>&lt;head&gt;
    &lt;title&gt;&lt;/title&gt;
   &lt;meta http-equiv="refresh" content="1;url=http://domain111.com/3.htm?Result=Yes" /&gt;
&lt;/head&gt;
</code></pre>

<p>Filename 2.htm on <strong>domain111.com</strong></p>

<pre><code>&lt;script type="text/javascript"&gt;
   parent.IamParent(); //execute the function from the same domain111.com/1.htm
&lt;/script&gt;
</code></pre>

<p>Please don't suggest AJAX or web request because it will not work with this case.</p>

<p>Thanks for reading.</p>
