Created
April 17, 2010 00:08
-
-
Save jeremeamia/369111 to your computer and use it in GitHub Desktop.
Check event bindings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adds a hasEvent() function for jQuery objects. | |
// Example: var hasClickEvent = $('a.add').hasEvent('click'); | |
(function($){ | |
$.fn.hasEvent = function(eventType){ | |
var events = this.data("events"); | |
return (events && events[eventType]); | |
}; | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment