views:

35

answers:

2

For example, i associate following function with some element

$('table#users tbody tr:first #save').click(function(){
    $(this).closest('tr').remove();
});

Now, if i don't know where this function is stored, is there a way to view associated with click() code? In above example, i want a way to view that in firebug, or in another way

$(this).closest('tr').remove();

If I'm writing in console following, i'm get a link to dom inspector

>>> ($('table#users tbody tr:first #save').click)
function()

but link is for jquery library, not the code i want.

+2  A: 

I think this will answer your question http://stackoverflow.com/questions/446892/how-to-find-event-listeners-on-a-dom-node/447106#447106

The reason you get a link to the DOM inspector on the code you wrote is because calling $(selector).click will actually raise the click events and return the result set.

SBUJOLD
yes, it exactly what i want, thanks
llamerr
+1  A: 

Try the eventbug plugin for Firebug: http://blog.getfirebug.com/2009/10/30/event-listener-view-for-firebug/

Ionuț G. Stan
and that would help too, thanks
llamerr