How to run a child window java script function in parent window after changing the url in the parent window?
<p>I want to execute the java script function of a child window on parent window, Even after changing the URL in the parent window.
I tried like below:</p>

<pre><code>**Parent.html:**

&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Parent window document&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;script type="text/Javascript"&gt;
    function openChildWindow()
    {
      var s_url     = "child.html";
      var s_name    = "ChildWindowDocument";
      var s_specs   = "resizable=yes,scrollbars=yes,toolbar=0,status=0";
      var childWnd  = window.open(s_url, s_name, s_specs);
      var div       = childWnd.document.getElementById("child_wnd_doc_div_id");
      div.innerHTML = "Hello from parent wnd dddsfds";
    }
  &lt;/script&gt;
  &lt;input type="button" value="Open child window document" name="sss" onclick="openChildWindow()" /&gt;
    &lt;div&gt;Click me: nothing will happen.&lt;/div&gt;
    &lt;div id="aaa" class="yourclass"&gt;
        &lt;p&gt;This is a paragraph with a &lt;span&gt;span&lt;/span&gt; where the paragraph's container has the class. Click the span or the paragraph and see what happens.&lt;/p&gt;
        This sentence is directly in the div with the class rather than in child element.
    &lt;/div&gt;
    &lt;div&gt;Nothing for this div.&lt;/div&gt;
    &lt;a&gt;dsfsd&lt;/a&gt;
  &lt;/body&gt;
&lt;/html&gt;

**child.html:**

&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Parent window document&lt;/title&gt;
    &lt;script&gt;
    opener.document.body.onclick = function(e) {
    var sender = (e &amp;&amp; e.target) || (window.parent.event &amp;&amp; window.parent.event.srcElement);
    document.getElementById("id").value=sender.tagName;
    }
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id="child_wnd_doc_div_id"&gt;child window&lt;/div&gt;
    ID: &lt;input type="text" id="id"/&gt;&lt;br/&gt;
    Name: &lt;input type="text" id="id"/&gt;&lt;br/&gt;
    Xpath: &lt;input type="text" id="id"/&gt;&lt;br/&gt;
    CSS: &lt;input type="text" id="id"/&gt;&lt;br/&gt;
  &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Clearly, my concept is: I want to execute the child window function after changing the url in the parent window.</p>
