window.close()在Firefox上不起作用,有什么解决方法吗? [英] window.close() doesn't work on Firefox, any work around?

查看:99
本文介绍了window.close()在Firefox上不起作用,有什么解决方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用window.close()关闭一个窗口,但这仅适用于IE,但不适用于Firefox。有没有人遇到过这个和任何解决方法?

I am trying to close a window using window.close() but this works on IE only but not on Firefox. Has anyone encountered this one and any work around?

谢谢...

推荐答案

您的脚本是否打开了窗口? Firefox 2及更高版本不允许脚本关闭他们没有打开的窗口。

Did your script open the window? Firefox 2 and later do not allow scripts to close windows that they did not open.

你可以尝试这个技巧,但我不知道它是否会奏效。我生活在人们的一边,认为用户应该控制他们的浏览器窗口,而不是应用程序(尽管事实上你可能有充分的理由)。

You could try this trick, but I have no idea whether it will work. I live on the side of the population that believes users should be in control of their browser windows, not applications (despite the fact you may have a good reason for this).

这篇关于window.close()在Firefox上不起作用,有什么解决方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆