Firefox:是否需要拼写检查?
是否有 JS 属性或命令来查看 Firefox 中的单词是否带有红色下划线(即需要进行拼写检查)?
理想情况下,对于示例代码,它会像...如果我右键单击带有红色下划线的单词,它将发出警报:
//watches for right click action
if(firefox.isUnderlinedForSpellcheck == true) {
//display firefox spellcheck menu
} else {
//perform my action
}
有人有任何想法吗?
Possible Duplicate:
Javascript: I have a custom right-click menu but still want the spellcheck!
Is there a JS property or command to see if a word is underlined in red (ie. needs to be spellchecked) in Firefox?
Ideally, for sample code it would be like... if I right click on a word the is underlined in red it will alert:
//watches for right click action
if(firefox.isUnderlinedForSpellcheck == true) {
//display firefox spellcheck menu
} else {
//perform my action
}
Anyone have any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为你不能,因为它是特定于浏览器的。您可以使用第二个拼写检查器,然后它们很可能都会发现相同的错误。
I don't think that you can since it's browser specific. You can use a second spellchecker and then it's most likely they will both find the same errors.
答案是:不要尝试在网站上创建您自己的自定义上下文菜单。没有人喜欢他们。
This is the answer: do not try to create your own custom context menu on a web site. Nobody likes them.
乔什·斯托多拉是对的。您正在尝试恢复通过自定义右键单击处理程序关闭的功能。如果您删除此处理程序,则 Firefox 将按照用户期望的方式运行。
大多数浏览器用户(尤其是 Firefox 用户)并不期望应用程序的功能来自上下文菜单。你把它放在那里对他们来说是一种伤害。他们期望浏览器功能(而不是特定于页面的功能)来自上下文菜单 - 而您却向他们隐藏了它。
您最好将这些菜单项直接放置在您的页面上(当然,使用适当的图标或其他内容)。这就是网络的运作方式。这就是人们期望它发挥作用的方式。
Josh Stodola is right. You are trying to get back functionality that you turned off by having a custom right-click handler. If you drop this handler, then Firefox behaves in the way that its users expect it to.
Most browser users (especially Firefox users) don't expect your application's functionality to come from the context menu. You are doing them a disservice by putting it there. They expect browser functionality (not page-specific functionality) to come from the context menu--and you are hiding it from them.
You would be better off to place these menu items directly on your page (with appropriate icons or whatever, of course). This is how the Web works. This is how people expect it to work.