javascript - How do I keep events elements added through a ajax call in jQuery "active" -


Code> $ (see "input #moremore"). Click (function () {var data = {first: oldest date, thread id: 1}; $ .post ("/ message / more", data, function (html) {$ ('Toddy # Post'). Embedded (HTML); Returns Folly;}, "html"); Return Fiji;});

Something like this is coming back with HTML:

Message output quote

all this is working fine and tied, everything looks like there is no problem.

The problem occurs when I have an event in the "quote" anchor that has been added through the AJAX call. In particular, why there is not a jQuery event fire on that anchor?

For example:

  $ ("# quote") .click (function () {...});  

Nothing. Acts as if there is no event in it. I know that it is working on other anchors on the page which was not added through AJAX request, so there is no code error, and if I If I refresh the page, I will set the fire properly. Is there some reason why this is happening, can I duplicate that incident on anchor tag somehow Need to start by? Any ideas?

Working with jQuery 1.3.1 1.2.6 or so) So I believe this is not my implementation code.

You can use jQuery 1.3, live all current and future matching elements In one event a handler will bind.


Comments