Created
January 13, 2014 08:20
-
-
Save mephraums/8396494 to your computer and use it in GitHub Desktop.
Code for logging events on an object
This file contains 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
$obj = $('input'); | |
function getEventsList($obj) { | |
var ev = new Array(), | |
events = $obj.data('events'), | |
i; | |
for(i in events) { ev.push(i); } | |
return ev.join(' '); | |
} | |
$obj.on(getEventsList($obj), function(e) { | |
console.log(e.type); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment