javascript:如何调试键盘事件 [英] javascript: How to debug keyboard events

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

问题描述

想想一下一个使用自定义键盘事件处理程序的Web应用程序,它可能会发生事件冒泡或事件捕获。

有没有办法(例如Firefox / Firebug addon)来调试每个按键/键盘事件,例如:




  • 显示事件类型和所有属性

  • trace这个JavaScript方法被称为

  • ,在事件冒泡的情况下,还有其他方法被调用



澄清我的问题:我不知道哪些方法处理程序存在和定义在哪里 - 这是我想要找出的。

解决方案

您可以尝试通过Firebug + Eventbug 扩展名。



有关不同浏览器中键盘事件的一般概述,请尝试: http://unixpapa.com/js/key.html


Imagine a web application which uses custom keyboard event handlers which might do event bubbling - or event catching.
Is there a way (e.g. Firefox/Firebug addon) to debug each keystroke/keyboard event, something like:

  • displaying the event type and all attributes
  • trace which javascript method had been called
  • in case of event bubbling which further methods have been called

To clarify my question: I don't know which method handlers exist and where they are defined - this is what I am trying to find out.

解决方案

You could try to visualize the vents with the Firebug + Eventbug extension.

For a general overview on keyboard events in different browsers, try this: http://unixpapa.com/js/key.html

这篇关于javascript:如何调试键盘事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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