ajax代码
是一个确认删除的按钮
可以检查一下dataType
我之前写了dataType: json
一直是数据库操作正常但是返回error
把 dataType: json 删掉就好了
function cancel(id){
if(confirm("确定要取消吗")){
$("#"+id).remove();
$.ajax({
url: '${base}industry/cancelRecord',
data: {id: id},
async: false,
type: "post",
success: function(){
alert("取消成功");
},
error: function(){
alert("取消失败");
}
});
}
}