$.ajax({
type: "POST",
url: “url/delete”,
contentType: "application/json",
data: JSON.stringify({
'deletId': id, //需要删除的数据
}),
dataType: 'JSON',
xhrFields: {
withCredentials: true
},
success: function (data) {
//删除成功
}
},
error: function (status) {
alert(status);
$(".notice").html('Error:' + status);//失败后执行的代码
}
}
);