layer ajax

$(document).on('click','.destroy_item',function() {
var _item = $(this);
var title = "确定删除该专栏作者?";
layer.confirm(title, {
btn: ['删除', '取消'],
icon: 5
},function(index){
var column_id = _item.children('.column_id').val();
$.ajax({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
url:"column/"+column_id,
data:{'_method':'delete'},
type:'post',
success:function(data){
var data_obj = JSON.parse(data);
if(data_obj.data == 1){
layer.msg('删除成功');
$("#"+column_id).remove();
}else{
layer.msg('删除失败');
}
}
},JSON);
layer.close(index);
});
});
最后修改:2019-11-17 21:18:05
69