开发者

why is this closing the new pop up window

开发者 https://www.devze.com 2023-01-03 22:43 出处:网络
I am trying to open a window and then redirecting the original page to a new location. Itopens thewindow, however before redirecting the parent page, it closes the newwindow too. How can I fix that

I am trying to open a window and then redirecting the original page to a new location. It opens the window, however before redirecting the parent page, it closes the new window too. How can I fix that

function orderPrint() {      
    var n = new Object();    
    n. ID = <?php echo $ID->ID; ?>;    
    n.action = posttothispage.php";    
    n.target = popWinCenterScreen("/common/html/empty.htm"开发者_如何学编程, parseInt(window.screen.height * 0.8), 796, "resize");    
    myFuction.PostRequest(n);    
    window.location = “someotherpagethanthis.php”;  
}  


Try using the onbeforeunload method to trigger the redirect before the opened window closes.

https://developer.mozilla.org/en/DOM/window.onbeforeunload

0

精彩评论

暂无评论...
验证码 换一张
取 消