且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

AJAX删除 - 使用jQuery

更新时间:2023-12-05 18:46:22

您需要拆卸只选择该项目的行。我不知道你怎么把它设置,但如果图像元素是行内,你可以使用:

You need to select only the item's row for removal. I'm not sure how you have it set up, but if the image element is inside the row you could use:

 $("img.delete").click(function() {
      var row = $(this).parents('tr:first');

      ...

      success: function(){
           $(row).remove(); //Remove the row containing the image element
           ...
      }

      ...
  });