开发者

How to close parent window on child window open using window.open()

开发者 https://www.devze.com 2022-12-20 04:39 出处:网络
Using javascript \"window.close()\" method after openi开发者_StackOverflow中文版ng new window using \"window.open\", it serve the problem i.e. but it will ask a confirmation message to user whether he

Using javascript "window.close()" method after openi开发者_StackOverflow中文版ng new window using "window.open", it serve the problem i.e. but it will ask a confirmation message to user whether he really wants to close the window or not... if user selects yes then the parent window will close and if not then he will remain on the same window and new window will not get open up..

So is there any way so that parent window will get closed without asking any confirmation message and new window will gets open up ?


No. It´s a security feature. You are trying to manipulate an application on another users machine.

If you put it in another context it becomes clear why it is as it is and why it should be that way: Would you like if your email client suddenly closed cause you read an email?

EDIT: What you can do is having the login window trigger a navigate event in it´s opener so the first page gets replaced by the billing info page. Then it can close itself.

0

精彩评论

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

关注公众号