Skip to content

Instantly share code, notes, and snippets.

@BartlomiejSkwira
Created April 25, 2013 14:24
Show Gist options
  • Save BartlomiejSkwira/5460099 to your computer and use it in GitHub Desktop.
Save BartlomiejSkwira/5460099 to your computer and use it in GitHub Desktop.
Bind event to closest ancestor when bound element is reloaded using JavaScript 'on'
// use a closer ancestor that is NOT destroyed. Best option if you can
$('#someAncestor').on('click', '.something', function() { /* ... */ });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment