views:

276

answers:

1

I use

$(window).bind( ... )

to set up event handlers, but for some reason I keep losing event handlers (i think). Is there any way when debugging (firebug) to see which custom events have been added to a given element?

Yours Andreas

+8  A: 

All events bound by jQuery (e.g not inline events) can be accessed through .data

var $el = $('#someId');
var allEvents =  $.data( $el , "events" );

or

$('#someId').data('events');

its very rare I bind events to the window object but the same notion should still apply so try $(window).data('events')

This does indeed work demo here (writes to console so use firefox + firebug)

redsquare
just figured it out myself and was about to post an answer to my own Q. you were lightning quick!
AndreasKnudsen
same here, you ninja-ed!
Yourdoom