Run JS function from parent window in child window?
<p>Want to run javascript function from parent window in child window </p>

<p><strong>Example</strong> </p>

<p>I have to different websites let's say <code>site1.com</code> and <code>site2.com</code></p>

<p>I want from <code>site1.com</code> to open new window of URL <code>site2.com</code></p>

<pre><code>new_window = window.open("site2.com/index.php", "window2");
</code></pre>

<p>Then i want to run a js function <code>test()</code> on this new_window.</p>

<pre><code>// Where site2.com/index.php 
&lt;html&gt;
    ......
&lt;/html&gt;
&lt;script&gt;
   function test(){
    // some code here
   }
&lt;/script&gt;
</code></pre>

<p><strong>Summary</strong> </p>

<p>Want to open new window (child) and run some JS functions from parent window.</p>
