Reputation: 27114
The old version of doing this doesn't seem to work..
$(".object").data('events');
..when I bind with this :
$(document).on("click", ".object", awesomePossumFunction() );
This does not show the events :
$(".object").data('events');
Upvotes: 3
Views: 256
Reputation: 95022
I suggest you not use .data('events'), it has been removed from newer versions of jQuery. You can access it at it's new location in newer versions of jQuery, but that also isn't suggested as it is subject to change.
Reference: http://bugs.jquery.com/ticket/10589
The important bits from that ticket is that in 1.7, changes to the event object were made that caused code that used .data('events')
to not function properly. The new location is jQuery._data(elem, "events")
Fiddle: http://jsfiddle.net/6PxFx/
Upvotes: 3
Reputation: 318212
It should work just fine if you check for events on the actual element it was bound to:
$(document).on("click", ".object", awesomePossumFunction); //binds to document
var events = $.data(document, 'events'); //jQuery 1.7.2 and below
var events2 = $._data(document, 'events'); //jQuery 1.8 ++
Upvotes: 2
Reputation: 1495
Your second line is something I never used. The handler might not be registered where you want it to. I would do this instead:
$(".object").on("click", awesomePossumFunction());
Let me know if this was of any good.
Upvotes: 0