Chrome and JS onclick function?

I wanted to check the chrome to see if it can show me which method will be executed for the onclick event registered.

So, I wanted to see what function JS performs shen people, raises the question:

http://i.stack.imgur.com/3mbce.jpg

enter image description here

But I could not find the actual code.

Is it possible with chrome to find which JS is executed when "onclick"?

Edit

I could use the console for this:

 $.each($(".vote-up-off").data("events"), function(i, e) { // this will work till jq 1.8 console.log(this) }); 

and here is our friend:

enter image description here

But hey !, I want chrome to do the job :-)

+8
javascript jquery debugging google-chrome
source share
2 answers

some workarounds available u can try this bookmarklet concept visual event

Bookmark your browser (always enable the bookmarks bar) and click on the bookmark on page u to debug

PS: this is for jQuery

+2
source share

A potential understanding may be to enter this into the console and press return:

 $('.vote a').data('events').click; 

jQuery saves all its events bound to the object inside the data () object ; therefore, if you want to view the binding of a specific event, this is your place to view it. The console will return the object. Expand handler <function scope> Closure , and now you can see all the JavaScript associated with it around this click event.

+2
source share

All Articles