Skip to content

Instantly share code, notes, and snippets.

@trentsnippets
Created February 12, 2014 03:13
Show Gist options
  • Save trentsnippets/8949432 to your computer and use it in GitHub Desktop.
Save trentsnippets/8949432 to your computer and use it in GitHub Desktop.
Jquery Attach Event Handler With .on
/*-------------------------------------------------------------------
| 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