title: Confirmation box pops up more than once using ajax
body: <p>I'm using Ajax to delete records and display an animated message (function display_message) when this record is deleted, but I noticed that the confirmation box pops up depending on the number of records. for example if I have 2 records in my list and I want to delete on of them.The confirmation box pops up twice before deleting and the same thing happen with the message, It appears twice(I'm using a message that fade in and out),
  and so on(3 records -> 3 pops up, etc). I tried a lot to resolve it but I haven't succeed .
  Here is my function that delete the records:</p>
  
  <pre><code>$(function() {
  $(".delete_class").click(function() {
  var id = $(this).attr("id");
  var dataString = 'id='+ id ;
  var parent = $(this).parent().parent();
  if(confirm("are you sure?")) {
  $.ajax({
  type: "POST",
  url: "delete.php",
  data: dataString,
  cache: false,
  success: function()
      {
     parent.hide();
      }
   });
  }
  display_message("user deleted!")
  }); 
  });
  </code></pre>
  
  <p>Please help.</p>
  
  <p>EDIT: here is the display_message function:</p>
  
  <pre><code>function display_message(msg) {
    $(".success").html(msg).effect("drop", { mode: "show", direction: "up" }, function( {
       window.timer = function() {
         $(".success").effect("drop", { mode: "hide", direction: "up"});
       }
  window.setTimeout("window.timer()", 3000);
    }
   )
  </code></pre>
  
  <p>}</p>