标签:修改 data func his date name module 信息 回调函数
修改前,会之间跳转不做停留
<script>
$(‘.del_digest‘).click(function(){
var id = $(this).attr(‘data‘);
layer.confirm("确定要删除数据吗?",
{btn:["确定","取消"]},
function () {
$.get("{:U(MODULE_NAME.‘/Digest/delDigest/id/"+id+"‘)}",function(date){
if(date.status==1){
window.location.reload();
layer.msg(data.msg,{time:1000,icon: 6});
}else{
layer.msg(date.msg,{time: 2000, icon:6});
}
},‘JSON‘);
},function () {
});
})
</script>
修改后,调用回调函数
<script>
$(‘.del_digest‘).click(function(){
var id = $(this).attr(‘data‘);
layer.confirm("确定要删除数据吗?",
{btn:["确定","取消"]},
function () {
$.get("{:U(MODULE_NAME.‘/Digest/delDigest/id/"+id+"‘)}",function(date){
if(date.status==1){
layer.msg(date.msg,{time: 1000, icon:6,end:function(){
window.location.reload();}});
}else{
layer.msg(date.msg,{time: 2000, icon:6});
}
},‘JSON‘);
},function () {
});
})
</script>
标签:修改 data func his date name module 信息 回调函数
原文地址:http://www.cnblogs.com/RZZG/p/7799154.html