- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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