tags:

views:

29

answers:

1

Hi.

I have a component in a vast codebase. Before I bind any events or do anything I want to fetch all the currently bound events for that components.

Does jquery provide a way to fetch all the currently bound events for a component?

Any help is appreciated.

Cheers

+1  A: 

jQuery stores the bound events in the special data functions of jQuery.

Try this out:

var events = $('div').data('events');
PetersenDidIt
Thanks. I'll give that a shot. Does that mean that "all the events" of all the components can be fetched that way.Someone mentioned that while attaching events if I give a namespace they can be fetched, but I am not sure what that means.
Priyank
This should contain every event bound on the element, might not contain live events but every normal event, namespaced or not, should be in there.
PetersenDidIt