Is it possible to show all active jQuery bind () functions?

Is it possible to show all active jQuery bind() ?

+6
javascript jquery
source share
2 answers

You can show all the data referenced by jQuery elements:

 console.log(jQuery.cache); // Logs the entire cache 

Or only for events (for those elements that have them):

 for(name in jQuery.cache) { if(jQuery.cache[name]['events']) console.log(jQuery.cache[name]['events']); } 
+4
source share

To do this at runtime using only a browser, use FireQuery: http://firequery.binaryage.com/

Using jQuery:

 var events = $('#element').data("events"); var firstClickEvent = events.click[0]; 

You can access all event handlers similar to an element. To get each of them, you will need to list the events variable.

+1
source share

All Articles