Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
How to debug JavaScript/jQuery event bindings with Firebug?
Let’s say an event handler is attached to your element. For example,
$('#foo').click(function() { console.log('clicked!') });
Then you can debug it like this:
For jQuery 1.3.x
var cEvent = $('#foo').data("events").click;
jQuery.each(cEvent, function(key, value) {
console.log(value)
})
For jQuery 1.4.x
var cEvent = $('#foo').data("events").click;
jQuery.each(cEvent, function(key, handlerObj) {
console.log(handlerObj.handler)
})
For jQuery 1.8.x+
var cEvents = $._data($('#foo')[0], "events").click;
jQuery.each(cEvents, function(key, handlerObj) {
console.log(handlerObj.handler)
}) Advertisements
