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
Try binding the function within the scope of the function where you dynamically create the element.
$('a.foo').on('click',function(event){ //your code goes here });