JavaScript事件序列 [英] JavaScript event sequence

查看:105
本文介绍了JavaScript事件序列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JavaScript中的某些事件在其他人之前发生。例如,使用输入元素,键控和按键事件首先触发。然后,如果那些的返回值不为false,则会更新input.value。然后,keyup事件触发。

Some events in JavaScript fire before others. For example, with an input element, the keydown and keypress events fire first. Then, if the return value from those was not false, the input.value is updated. Then, the keyup event fires.

是否有一个网站,我可以找到所有事件及其执行顺序的完整列表,以及其他之间发生的事情,例如更新我示例中输入框中的值?

Is there a web site where I can find a comprehensive list of all events and the order in which they are executed, as well as other things that take place in between, such as updating the value in the input box in my example?

这样的列表将非常有用。

Such a list would be extremely helpful.

推荐答案

对于关键事件,以下是一个很好的资源: http://unixpapa.com/js/key.html 。在 http://unixpapa.com/js/mouse上的同一个网站上还有一个页面。 html ,我没有使用,但我想象的是基于关键事件页面是有用的。

For key events, the following is an excellent resource: http://unixpapa.com/js/key.html. There's also a page for mouse events on the same site at http://unixpapa.com/js/mouse.html that I haven't used, but I imagine is useful based on the key events page.

这篇关于JavaScript事件序列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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