window.blur() 不适用于 Firefox 4
我有一个功能,激活后会在当前浏览器窗口下打开一个新窗口作为弹出窗口。它在所有过去版本的 IE 和 FF 上都工作得很好,现在它已经停止工作了。显然,Mozilla 更改了 FF 4 的一项设置来防止这种情况发生:http://support。 mozilla.com/en-US/questions/806756
这是我正在使用的代码:
function popup(page) {
var myWin = window.open(page,"mywindow","menubar=1,resizable=1,status=1,toolbar=1,location=1,directories=1,scrollbars=1");
opener = myWin.blur();
}
如何让此代码在 FF 4 上运行?
I have a function that when activated opens a new window as a pop-under under the current browser window. It was working fine with all past version of IE and FF, now it has stopped working. Apparently Mozilla has changed one of the setting of FF 4 to prevent this: http://support.mozilla.com/en-US/questions/806756
Here is the code I am using:
function popup(page) {
var myWin = window.open(page,"mywindow","menubar=1,resizable=1,status=1,toolbar=1,location=1,directories=1,scrollbars=1");
opener = myWin.blur();
}
How can I get this code to work on FF 4?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您似乎无法控制此行为...
http:// /support.mozilla.com/en-US/questions/806756#answer-167267
Doesn't look like you have control over this behavior...
http://support.mozilla.com/en-US/questions/806756#answer-167267
如果您让弹出窗口创建另一个子窗口,关闭它,然后模糊弹出窗口,这似乎可行。就像这样:
It seems to work if you make the popup create another child window, close it, then blur the popup window. Like so: