How to embed a url/page redirection script to a closing pop up window
<p>Please am making use of this script bellow to execute a pop up window when the close button is clicked on but i want to add an extra script that will help me open a new url/page when the "OK" button is clicked please can anyone help me out, here is the javascript am using:   </p>

<pre><code>&lt;script language="Javascript"&gt; 
    var needToConfirm = true;
    window.onbeforeunload = confirmExit;
    function confirmExit(){
        if (needToConfirm){
            my_window = window.open ("1.html","mywindow1","status=1,width=350,height=150");
           return "You have attempted to leave this page. If you have made any changes "
          +"to the fields without clicking the Save button, your changes will be "
          +"lost. Are you sure you want to exit this page?";
      }
    }
&lt;/script&gt;
</code></pre>
