简体   繁体   中英

JavaScript keypress in Windows Phone

I'm trying to handle keypress event in Windows Phone's browser via JavaScript. Here is working example: http://jsfiddle.net/alex_myronov/c5n4C/2/ . But as I change input value the handler is not triggered. It triggered only in case inpu t lost focus. Does someone know how to deal with it?

Try the keydown event as opposed to keypress, I believe keypress isn't consistently implemented.

<input data-bind="event: {keydown: changeStatus}, valueUpdate: 'afterkeydown'"></input>

For more information on the difference between the two read here: What's the difference between KeyDown and KeyPress in .NET?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM