Possibly one of the most frequently asked questions: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F
On Jul 8, 1:54 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi folks, > > I have a page with a photo on it. I load the comments for this photo > via an ajax request: > > var item_id_val = $("#item_id").val(); > > $.post("/show_comments", item_id: item_id_val }, function(data) > { > /* Update the comment_section div. */ > $("#comment_section").html(data); > > }); > > That works fine, but the html data that /show_comments returns doesn't > work with jQuery. For example, users can "thumb up" or "thumb down" > comments, but if the html code is loaded via AJAX the .click events > are not "binded" to that loaded data. > > How can I fix this problem? > > Any ideas or help would be greatly appreciated. > > Thanks, > Konstantin