问题描述:

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:

<body onbeforeunload="window.open('BondData.aspx');">

but it does not work. Can you please guide me to an idea where I can get this working?

Thanks in advance

网友答案:

try this:

Add this code on page on which you going to close

<script >
window.onbeforeunload =      

  function ()
    {

    window.open('NewPage.aspx');
    };
</script >
相关阅读:
Top