アンカータグを削除するには、それぞれの行を削除したいと思います。アンカータグを削除するには、それぞれの行を削除したい
サーバーの応答から私は1を取得していますが、動作していないアンカータグの親の親を削除しようとしています。ここで
私のHTMLコードとしてコード
です:
<tr>
<td><?php echo $w_value['pro_name']; ?></td>
<td><?php echo $w_value['sellingprice']; ?></td>
<td><a class="remove_wishlist" href="javascript:;" data-uid="<?php echo $uid;?>" data-pid="<?php echo $w_value['id']; ?>">Remove</td>
</tr>
そして私のAjaxコードです:
jQuery(document).on("click",".remove_wishlist",function(){
if(confirm('Are you sure to remove this item.')){
var pid = jQuery(this).data("pid");
var uid = jQuery(this).data("uid");
var urll = WEBSITE_URL+"pages/removewishlist";
var $this = $(this);
$.ajax({
type:'post',
url:urll,
data:{pid:pid,uid:uid},
success:function(data){
console.log(data);
if(data == 1){
$this.parent().parent("tr").remove();//this is not removing the entire row
}
}
});
}
});
が正しかった問題が==「1」は正しい比較データにありました。 –