为什么window.focus()无法在Mozilla Firefox中运行? [英] why window.focus() not working in Mozilla firefox?

查看:104
本文介绍了为什么window.focus()无法在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 复选框,然后检查升高和降低窗口框。

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屋!

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