One benefit of calling functions directly from markup is that it is easier to track what's being called. I would like to know if there is an browser addon or something that supports a "Goto javascript source function" for eac开发者_开发技巧h of the events attached (bound) to an element. Ideally this would take me to the original location it got bound.
You can use FireQuery add on with Firefox browser. It will show you all the events attached to a dom element.
https://addons.mozilla.org/en-US/firefox/addon/firequery/
The built-in Chrome 12 debugger will show you any Event Listeners for any object in the DOM. It can be quite useful, especially to find your way around a larger project. It shows you what event and where the code is.
精彩评论