I\'ve come to maintain a piece of javascript that downloads some JSON data from the server, builds a new table row (like $(\') and inserts i
$(\') and inserts i
You can use event delegation like so.
$('body').on('click','.foo',function(){ alert('foo'); });
This will allow you to set the event handler before the element is present.