Created
February 12, 2014 03:13
-
-
Save trentsnippets/8949432 to your computer and use it in GitHub Desktop.
Jquery Attach Event Handler With .on
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
/*------------------------------------------------------------------- | |
| This will attach an eventHandler to an object even if it is added | |
| to the DOM after doc.ready / .load via ajax etc... | |
|-------------------------------------------------------------------- | |
*/ | |
jQuery( "body" ).on( "event", "element", function() { | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment