本文介绍了使用window.close()关闭当前窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我想在IE6.0中使用window.close()关闭当前窗口时, 会有一个确认框:网页您正在查看的页面正在尝试 关闭窗口。你要关闭这个窗口吗? 我必须单击是关闭窗口。 如果没有此对话框,如何直接关闭当前窗口? 谢谢。
Hi, When I want to close the current window using window.close() in IE6.0, there will be a confirm box that: The web page you are viewing is trying to close the window. Do you want to close this window? I have to click yes to close the window. How can I close the current window directly without this dialog box? Thank you.
推荐答案希望这会有所帮助: = ================ window.opener = self; window.close(); ================= ..Andrew Hope this helps: ================= window.opener = self; window.close(); ================= ..Andrew
只有当只有一个窗口并且不能关闭时才会出现此警报。 This alert occurs only if there is only one window and cannot be switched off.
您确定吗? 我想这可能与安全有关,但方法不明确 足够。 下面臭名昭着的代码确实如此在Firefox中不起作用:)) ========== < html> < ; body onclick =" alert(''ooops''); window.opener =自我; window.close();"> 点击此页面并调用window.close()。 < / body> < / html> ========= 尽管如此,我已经在Opera和IE中检查过,两者都成功了。 Are you sure? I guess it could be security-dependent, but the approach is not clear enough. The notorious code below does not work in Firefox :)) ========== <html> <body onclick="alert(''ooops''); window.opener=self; window.close();"> Click this page and window.close() is called. </body> </html> ========= Nevertheless, I''ve checked it in Opera and IE, both succeeded.
更多推荐
使用window.close()关闭当前窗口
发布评论