Createive

Createive

  • NA
  • 3
  • 725

redirect to other page once click close the current page

Dec 17 2015 2:32 AM
 

I am new to JavaScript Programming. What I want to do is the following: I am opening popup window for the user to print something. once he finishes, he will close the page. I want the portal to open another page once he closes this page. I tried the following:

<script >
window.onbeforeunload =      

  function ()
    {

    window.open('NewPage.aspx');
    };
</script >

but unfortunately, it closes both the new page and the old page. Can you please help.

Thanks in advance


Answers (3)