0

Possible Duplicate:
Accessing functions bound to event handlers with jQuery

I have a around 10 jQuery plugins on my page. It seems that some elements have two events attached to it because one ajax call let say when .change() happen in a textbox fires two post calls. Is there in Firebug, or in some other tool or browser than Firefox (I did not find one) where you can see events that are attached to a page's elements?

Community
  • 1
  • 1
TheMentor
  • 464
  • 9
  • 25
  • 2
    If it's jQuery, `jQuery(elem).data('events');` or `$._data($(elem).get(0), "events")` used to work, not sure about the latest version though. On the other hand 9 of those plugins are probably for something you could easily do with a few lines of code yourself ? – adeneo Dec 03 '12 at 00:16
  • …but this questions title is better. – feeela Dec 03 '12 at 00:19
  • @feeela, yes indeed, the referenced question's title is little more than gobbledygook. – Beetroot-Beetroot Dec 03 '12 at 00:34
  • @adeneo, your second example works in jQuery 1.9+ as of this time. http://jquery.com/upgrade-guide/1.9/#data-events-. Also relevant is an explanation of the "private" $._data method. http://stackoverflow.com/questions/7788353/whats-the-difference-between-jquery-data-and-jquery-data-underscore-data – BradGreens May 21 '13 at 15:33

1 Answers1

3

There's Eventbug, an extension to Firebug, which

lists all of the event handlers on the page grouped by event type

pixelistik
  • 7,541
  • 3
  • 32
  • 42
  • nice plugin, but if one uses a JS lib (I tested with jQuery), this plugin will only render useless information, as it prints the jQuery internals, instead of the of the function passed as event handler. – feeela Dec 03 '12 at 09:40