dkoug Blog

Delete table row

jquery -- Posted on July 17, 2017

Delete table row

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
(function($){
    $(document).ready(function(){
      $('.delete').on('click', function(e){
          e.preventDefault();
          var that = $(this);
          var url = $(this).attr('href');
          var c = confirm("Delete the object");
          if (c == true) {
            $.post(url, function( data ) {
              $(that).parent().parent().fadeOut();
            });
          }
          return false;
      })
    });
})(jQuery)