开发者

Detect if using IME for input in browser

How would I go about checking whether the user is using an IME to input text? For instance, if you look at Google Docs开发者_如何学运维, they seem to use some kind of intermediate IFrame to capture it before putting it in the actual document <div>s.


The W3C DOM Level 3 specifies the event compositionstart and friends for detecting IME input. For browsers that don't support those events, some hacking around is required.

The Closure library has an example for this: http://closure-library.googlecode.com/svn/docs/closure_goog_events_imehandler.js.source.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜