#删除按钮
//添加到表格里面的按钮
<button class="shanchu btn btn-danger" style="width:auto;">删除</button>
$("table tbody").on("click","button",function () {
// alert("right");
// window.open("https://www.baidu.com");
del(this);
})
function del(a){
var user={
"id":a.parentNode.parentNode.childNodes[0].textContent
};
$.ajax({
type:'post',
url:'',
pagination: true,
contentType: "application/json; charset=utf-8",
data : JSON.stringify(user),
dataType : 'json',
success:function(response){
if(response.code == 200){
alert("cg")
window.location.reload();
}
if(response.code == 400){
alert("错误!");
}
},
error:function(xhr){
alert("失败");
}
});
}