0

I want to reditect the page when i close the browser close button.I have this code but it is not working.Please help me.how can i do this.

window.onbeforeunload = function() {
    if (window.confirm('yes/no?'))
    {
        window.location="http://www.google.com";
    }
    else
    {
          alert('staying this page');
    }
}
Dennis Kriechel
  • 3,719
  • 14
  • 40
  • 62

0 Answers0