电脑版弹窗
layer.open({
content: '您确定要删除吗?删除后无法恢复'
,btn: ['确定', '取消']
,yes: function(index){
//location.reload();
///
$.ajax({
url:'/school/student/del/',
type:"post",
datatype:"json",
data:{"id":id},
success:function(res){
if(typeof res != 'object')
{
res = JSON.parse(res);
}
if(res.status==1)
{
layer.open({
content: '删除成功'
,btn: '我知道了'
,end:function(){
window.location.href = "/school/student/";
}
});
}else if(res.status==0)
{
layer.open({
content: res.msg
,btn: '我知道了'
});
}
},
error:function(){
layer.open({
content: "操作错误,请稍后再试"
,btn: '我知道了'
});
}
});
///
layer.close(index);
}
});
手机版弹窗
layer.open({
content: '你是想确认呢,还是想取消呢?',
btn: ['确认', '取消'],
shadeClose: false,
yes: function(){
layer.open({content: '你点了确认', time: 1});
}, no: function(){
layer.open({content: '你选择了取消', time: 1});
}
});