我怎样才能赶上firefox拼写检查校正事件? [英] How can i catch the firefox spellcheck correction event?

查看:124
本文介绍了我怎样才能赶上firefox拼写检查校正事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个textarea。在写入一些拼写错误的文本并使用右键 - >更正后,单词被替换为拼写正确的单词。
现在,我的问题是我需要执行一些JavaScript代码,当更正完成。



我怎样才能赶上firefox拼写检查校正事件?
如果只有一个解决方案使用Firefox附加组件,我也很高兴知道这一点。

解决方案

在这种情况下,Mozilla会触发 oninput ,而不会在其他人测试,但应该无处不在。



有趣的是,FF似乎在使用拼写纠正时触发了两个输入事件:它先删除这个单词,然后插入新的:

 >价值= [圣牛] 
(右击并选择牛)
>值= [圣]
>值= [圣牛]

http://jsfiddle.net/7ssYq/


I have a textarea. After writing some misspelled text and using rightclick -> correction the word gets replaced with a correctly spelled word. Now, my problem here is that i need to exectue some javascript code when the correction gets done.

How can i catch the firefox spellcheck correction event? If there is a only a solution using a firefox Add-On i would be happy too to know that one.

解决方案

Mozilla fires oninput in this case, didn't test in others, but should work everywhere.

Interestingly enough, FF seems to fire two input events when using spelling correction: it deletes the word first, and then inserts the new one:

> value=[holy coww]
(right click and choose "cow")
> value=[holy ]
> value=[holy cow]

http://jsfiddle.net/7ssYq/

这篇关于我怎样才能赶上firefox拼写检查校正事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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