JavaScript的焦点在Firefox [英] Javascript focus in firefox

查看:105
本文介绍了JavaScript的焦点在Firefox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当页面加载时,我想关注一个特殊的文本框。我用js函数focus()来做这个,它工作正常。但是当我在Firefox的新标签中打开页面时,它并不关注文本框。
有什么想法?

解决方案

是的。它不能在Firefox中工作。我不知道为什么。但是,它的工作原理,如果我们在Firefox中执行以下操作。去
工具 - >选项
点击标签。
检查选项当我在新选项卡中打开一个链接,立即切换到。

这会直接将您带到已打开的选项卡上,并且集中在一起工作。这不是解决方案。这将只适用于你的Firefox的课程。不能保证用户有选择检查。 :(


I want to focus on a special textbox when page is loaded. I do this with js function focus() and it works fine. But when I open the page in a new tab in firefox, it doesn't focus on the textbox. any idea?

解决方案

yep. It doesn't work in firefox. i dunno why. But it works, if we do the following in firefox. go to Tools --> Options click on Tabs. Check the option "When i open a link in a new tab, switch to it immediately".

This will take you to the opened tab directly and onfocus works. This is not the solution. This will work only on your firefox ofcourse. can't guarantee users have that option checked. :(

这篇关于JavaScript的焦点在Firefox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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