您的位置:首页 > Web前端 > JavaScript

Close Window in IE from javascript. (Small Hack)

2008-11-25 14:51 295 查看

Close Window in IE from javascript. (Small Hack)

Written by Kumar S

Posted July 13, 2005 at 12:22 pm

When trying to close an window from javascript in IE, which is opened manually,
a security warning “The web page you are viewing is trying to close the window. Do you want to close this window? Yes|No ” is popping up. Is there any possibility to close a window silently? Yes.

-----------------------------------------------------------

Solution:

1)

A simple hack i found on the web will help to get rid of this situation.
this.focus();
self.opener = this;
self.close();
2)
Page.ClientScript.RegisterStartupScript(Me.GetType(), "close", "window.open('','_parent','');window.close();", True)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐