简体   繁体   English

如何确定触发哪些JavaScript事件

[英]how to determine which JavaScript events are being triggered

正如标题所说,当我与网页交互时,如何找到触发的JavaScript事件?

when you have firebug installed, the following functions will gather data of all the javascript functions being triggered, and how much time is spent executing them: 当你安装了firebug时,以下函数将收集所有被触发的javascript函数的数据,以及执行它们花费的时间:

console.profile([title])

Turns on the JavaScript profiler. 打开JavaScript分析器。 The optional argument title would contain the text to be printed in the header of the profile report. 可选参数标题将包含要在配置文件报告的标题中打印的文本。

console.profileEnd()

Turns off the JavaScript profiler and prints its report. 关闭JavaScript分析器并打印其报告。

More info can be found at http://getfirebug.com/console.html 有关更多信息,请访问http://getfirebug.com/console.html

Firebug extension of firefox is a great piece of software to let you know about that and many other things. Firefox的Firebug扩展是一个很棒的软件,让你了解这个和许多其他的东西。 Also here are couple of links to help you: 这里有几个链接可以帮助您:

Debugging JavaScript events with Firebug 使用Firebug调试JavaScript事件

http://www.dustindiaz.com/event-capturing-evil/ http://www.dustindiaz.com/event-capturing-evil/

所有这些帖子都是有用的,当然是萤火虫,我从个人经验中建议这个屏幕演员帮助我,它被称为“jquery中的事件委托”

Use the Stack Tab in Firebug. 使用Firebug中的Stack选项卡。 Put a debugger somewhere , and in the Script tab , at the right hand side , there are three tabs also . 将调试器放在某处,在脚本选项卡的右侧,还有三个选项卡。 Look at the Stack tab to see the details. 查看“堆栈”选项卡以查看详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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