Tags

,

Rebinding function to dynamic content with live !

Change from …
$(document).ready(function(){
$(‘#my-id’).click(function(){ dosomethink(); });
});

to …

$(‘#my-id’).live(‘click’, function() { dosomethink();});

References:
http://stackoverflow.com/questions/506764/rebinding-functions-on-dynamic-content-using-jquery-and-ajax
http://api.jquery.com/live

Advertisements