IE7提示关闭的解决方法 兼容IE和Firefox的打开新窗口,关闭父窗口,不提示解决方法 2009年8月21日 发布:风 解决方法如下: <SCRIPT LANGUAGE="javascript"> newWindow=window.open ('http://www.baidu.com', "anyname", "fullscreen=1") ; window.opener=null; window.open("","_self"); window.close(); </script> string script = "window.open('NewHtml.html', '_blank','fullscreen=1');window.opener=null;window.open('','_self');window.close(); "; 现在解决IE,Firefox兼容问题,之所以window.close在firefox不能使用,是因为firefox默认不能关闭用户打开的网页,我们可以这样设置firefox:打开firefox,在地址栏输入about:config找到dom.allow_scripts_to_close_windows这项并改为true。现在知道为什么了吧。众所周知,在javascript中window.close()是用来关闭窗口的,而且ie和firefox都是支持的。 顶 Top 收藏 关注 评论