title: Open child window and redirect parent window
body: <p>I have a JavaScript that opens a new window when a button is clicked.  It works fine.  But, I want to <strong>re-direct the Parent Window</strong> (i.e. the current page) once the new window is opened.</p>
  
  <p>Here is my script :</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function OpenWindow() {
      window.open('/My_Folder/file.php',
                  'newwindow',
                  config='height=670,width=1400,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no');
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>And, the button:</p>
  
  <pre><code>&lt;input type="button" value="Submit" onclick="OpenWindow()"&gt;
  </code></pre>
  
  <p>So, in order to be able to re-direct the Parent Window, after the new window has popped up, I added a simple line to my JS function :</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function OpenWindow() {
      window.open('/My_Folder/new_file.php', 'newwindow', 
                  config='height=670,width=1400,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no, status=no');
  }
  
  setTimeout(1000, '/My_Folder/PHP/file_2.php');
  &lt;/script&gt;
  </code></pre>
  
  <p>Meaning, after the new window has popped up, the Parent Window should <strong>re-direct in 1 second.</strong></p>
  
  <p>But, for some reason, it's not working.</p>
  
  <p>Online searches have only given me solutions for situations involving the reverse :  <strong>re-direct the Parent Window after CLOSING the child-window.</strong></p>
  
  <p>I want to re-direct the Parent Window after opening a new (child) window.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>So far, I've tried these 3 ways :</p>
  
  <pre><code>   (a)  &lt;script type="text/javascript"&gt;
     function OpenWindow()    {
     window.open ('/My_Folder/new_file.php', 'newwindow', 
     config='height=670, width=1400,   
     toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, 
     directories=no, status=no');
     window.top.location.href = '/My_Folder/PHP/file_2.php'
     }
     &lt;/script&gt;
  
  
   (b)  &lt;script type="text/javascript"&gt;
   function OpenWindow() { window.open('/My_Folder/file.php','newwindow',         
   config='height=670,width=1400,toolbar=no,menubar=no,scrollbars=no,
   resizable=no, location=no,directories=no,status=no');
   settimeout( function(){document.location='/My_Folder/PHP/file_2.php'}, 1000    
   );
   }
   &lt;/script&gt;
  
  
   (c) &lt;script&gt;
       function OpenWindow()    {
      window.open ('/My_Folder/new_file.php', 'newwindow', 'height=670, 
      width=1400, toolbar=no, menubar=no, scrollbars=no, resizable=no, 
       location=no, directories=no, status=no');
  
          window.location = '/My_Folder/PHP/file_2.php';
       }
       &lt;/script&gt;
  </code></pre>
  
  <p>Of all these, none are working.</p>
  
  <p>But  <strong>(b)</strong> is the best solution so far, because, at least, <strong>it opens the New (Child) Window</strong>, as it should.  But, it still does not re-direct the Parent Window  :(((</p>