开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜