Skip navigation.

极湖

无不用其“极”

IME 打开时 Firefox 不触发 keyup 之解决方法

, ,

输入法打开时, Firefox 不触发 keyup 事件。经常写javascript代码的人,尤其是中日韩等国的人,都可能会遇上这个不大好解决的问题,。

在一个日文 Blog 上找到了解决办法,用 jQuery 通过 text 事件实现。
自己写了一段测试代码如下:

var logFunc = function(e){
  console.log($(this).val());
  if(e){
    // keyup 时能取到键值
    console.log(e.keyCode)
  }
};
$(':text').keyup(logFunc).text('text', logFunc);

一些东西搬迁至 GAEconsole.log Everywhere

Write a comment

You must be logged in to write a comment. If you're not a registered member, please sign up.

November 2009
S M T W T F S
October 2009December 2009
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30