BartlomiejSkwira
4/25/2013 - 2:24 PM

Bind event to closest ancestor when bound element is reloaded using JavaScript 'on'

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() { /* ... */ });