you need to re-initialize the click handler if you replace the element it was referring to.
On Fri, Aug 22, 2008 at 8:44 PM, SHiDi <[EMAIL PROTECTED]> 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 :) >