That helps a lot. Thanks so much. Earlier, I had to use obtrusive Javascript, so not cool. Now, no longer.
Once again, thanks a lot for your help. Topic can be close now :) Cheers! On Aug 23, 12:09 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote: > You have run into a fairly common issue: how to get events to work > with elements that are added to the DOM, through either ajax or simple > DOM mainpulation, after the "document ready" code has already fired. > > This FAQ topic should answer your question: > > http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_st... > > If you still have problems after reading through it and trying one of > the many solutions, let us know. > > --Karl > > ____________ > Karl Swedbergwww.englishrules.comwww.learningjquery.com > > On Aug 22, 2008, at 2:44 PM, SHiDi wrote: > > > > > Hi all. > > > I've tried to reload a content using jQuery.post. However, it seems > > that once the content is reloaded, the script didn't work the way it > > supposed to. > > > My jQuery script is: > > > $(".click").click(function() { > > alert('Hello World'); > > > $.post('actions.php', > > {}, > > function(data) { > > $("#new").html(data); > > }); > > }); > > > Content for actions.php: > > > echo '<a href="#" class="click">Click Me Again</a>'; > > > As for the HTML: > > > <div id="new"> > > <a href="#" class="click">Click Me</a> > > </div> > > > On first click, the script will work. But once the content reloaded, > > it's no longer work. Any idea why? > > > Thanks in advanced :)