开发者

how to determine which JavaScript events are being triggered

开发者 https://www.devze.com 2022-12-18 04:10 出处:网络
As the title says, how can I find what JavaScript events are being trigge开发者_高级运维red as I interact with a webpage?when you have firebug installed, the following functions will gather data of al

As the title says, how can I find what JavaScript events are being trigge开发者_高级运维red as I interact with a webpage?


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:

console.profile([title])

Turns on the JavaScript profiler. 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.

More info can be found at 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. Also here are couple of links to help you:

Debugging JavaScript events with Firebug

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


All these posts are useful , firebug of course , and I suggest from personal experience this screen-cast helped me , its called "event delegation in jquery"


Use the Stack Tab in Firebug. 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.

0

精彩评论

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

关注公众号