为什么window.focus()无法在Mozilla Firefox中运行? [英] why window.focus() not working in Mozilla firefox?
问题描述
我需要关注进一步点击锚标签时打开的窗口。我使用了以下函数来执行此操作。
I need to focus on window opened on further clicks on anchor tag. I have used the below function to do so.
function newwindow(url)
{
OpenWin = this.open(url,"mywindow");
OpenWin.focus();
}
OpenWin.focus()无法在Mozilla Firefox上运行。有没有其他解决方案专注于进一步点击锚标签打开的窗口?
OpenWin.focus() is not working on Mozilla Firefox. Is there any other solution to focus on window opened on further clicks on anchor tag?
推荐答案
您可能需要允许脚本引发窗口,因为默认情况下Firefox不允许这样做。
You probably need to allow scripts to raise windows, since Firefox does not allow that by default.
在选项
对话框的内容
标签中,点击高级...
按钮旁边的启用Javascript
复选框,然后检查升高和降低窗口结果对话框中的code>框。
In the Content
tab of the Options
dialog, click the Advanced...
button next to the Enable Javascript
check box, then check the Raise and lower windows
box in the resulting dialog.
这篇关于为什么window.focus()无法在Mozilla Firefox中运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!