title: delete record from database without refreshing
body: <p>I have an code where it is supposed to delete the data without refreshing. the delete process works but i have to refresh to to remove the data. 
  heres my code please help me</p>
  
  <p>Ajax:    </p>
  
  <pre><code>$(function () {
    $(".trash").click(function () {
      var del_id = $(this).attr("id");
      var info = 'id=' + del_id;
      if (confirm("Sure you want to delete this post? This cannot be undone later.")) {
        $.ajax({
          type: "POST",
          url: "delete.php", //URL to the delete php script
          data: info,
          success: function () {}
        });
        $(this).parents(".record").animate("fast").animate({
          opacity: "hide"
        }, "slow");
      }
      return false;
    });
  });
  </code></pre>
  
  <p>Here's my html: </p>
  
  <pre><code>&lt;td style="padding-left: 23px"&gt;
      &lt;img class="photo" data-toggle="modal" data-target="#gallery&lt;?php echo $photo; ?&gt;"  src="&lt;?php echo $r1['photo'];  ?&gt;" /&gt;
  
      &lt;div class="hotel"&gt;
          &lt;button class="trash" id="&lt;?php echo $r1['photo_id']; ?&gt;" &gt; &lt;span class="glyphicon glyphicon-remove" aria-hidden="true"&gt;&lt;/span&gt;&lt;/button&gt;
      &lt;/div&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>If I hover the button to the image the <code>.trash</code> button will appear and if I click it the image must be deleted. help me please.         </p>