多个swal弹框套用时,href无法使用的问题
当多个多个swal弹框套用时,最底层的swal的function()方法中的href无法使用。
swal({title: "",text: " 同时设置子部门",html: true,type: "info"}, function(){var ChildInherit="N";if( document.getElementById("ChildInherit").checked){ChildInherit="Y";}var postData={GroupID:GroupID,ChildInherit:ChildInherit}$http.post('/xxx/xx/xx', postData).success(function (data) {if(data=="T"){swal({title: "修改成功",confirmButtonText: "确定", closeOnConfirm: false},function () {location.href = '../Group/Quota?id=' + $scope.GroupID + "&Ctrl=BillingMode&JumpID=0";});}else{swal("修改失败");}});});
可以在swal之后调用setTimeout,代码修改如下
swal({title: "",text: " 同时设置子部门",html: true,type: "info"}, function(){var ChildInherit="N";if( document.getElementById("ChildInherit").checked){ChildInherit="Y";}var postData={GroupID:GroupID,ChildInherit:ChildInherit}$http.post('/xxx/xxx/xx', postData).success(function (data) {if(data=="T"){swal({title: "修改成功",confirmButtonText: "确定", closeOnConfirm: false});window.setTimeout(location.href = '../Group/Quota?id=' + $scope.GroupID + "&Ctrl=BillingMode&JumpID=0",700);}else{swal("修改失败");}});});}
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
