Hello everyone.

I'm trying to solve a very tricky problem here.  The problem is as
follows:

On a page, there is a $(document).ready() function, let's assume it
does something simple:

$(document).ready(
   function(){
      $(".alerter").click( function(){ alert('you clicked me.'); } );
   }
);

It works great, I click on an "alerter" and I get an alert.

Now, on this page AJAX is invoked, and a new div, containing several
"alerter"s, is inserted into the DOM.

How do I then run the $(document).ready() function on *only* this new
div that has been inserted into the DOM?  If I rerun the entire $
(document).ready() function, the original "alerter"s will have the
click function bound twice.

Anybody know a way around this?

Thanks,
-sam

Reply via email to