how to redirect in other page when browser close event called
<p>I want to redirect in another page when browser is closed. My code is following:</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?";
  }
}
</code></pre>

<p>But when I am clicking on close button of browser, I am seeing an <strong>system confirmation message</strong> and I am also not getting pop up page opening in mozilla. How will i resolve this problem?</p>

<p>Thanks</p>
