admin管理员组文章数量:1287505
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() is not working on Mozilla Firefox. Is there any other solution to focus on window opened on further clicks on anchor tag?
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() is not working on Mozilla Firefox. Is there any other solution to focus on window opened on further clicks on anchor tag?
Share Improve this question edited Jan 4, 2014 at 18:17 BenMorel 36.6k51 gold badges205 silver badges336 bronze badges asked Nov 3, 2010 at 9:15 JyotiJyoti 2,1153 gold badges27 silver badges30 bronze badges4 Answers
Reset to default 5You probably need to allow scripts to raise windows, since Firefox does not allow that by default.
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.
The checkbox does not exist anymore in newer ff versions
The only way to change the setting is the dom.disable_window_flip
about:config option
You can disable/enable Javascript's window.focus
event from the Firefox options:
Go to Tools > Options > Content > Advanced > Raise or lower windows
There is no way to overwrite this option serverside, because it was made for exactly that purpose: Hindering windows from stealing focus. Your only option is to use model windows on top of your website, which are essentially "the new popup windows".
I assume that FF follows the HTML standard which states the following:
window . focus()
Focuses the window. Use of this method is discouraged. Allow the user to control window focus instead.
i.e. we are not able to do the window focusing.
本文标签: javascriptwhy windowfocus() not working in Mozilla firefoxStack Overflow
版权声明:本文标题:javascript - why window.focus() not working in Mozilla firefox? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741271850a2369445.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论