layer.open 提交成功自动关闭窗口,并重新加载页面
作者:互联网
两个open
success: function (data1) { if(data1.resultCode==0){ layer.msg('办结成功!', { icon: 1, time: 2000 //2秒关闭(如果不配置,默认是3秒) }, function(){ layer.close(index); window.parent.layer.getFrameIndex(); window.parent.layer.close(index); parent.location.reload(); return false; }); }else{ layer.alert("办结失败!"); } layer.close(index); }, error: function (data1) { console.log("接口异常!"); }
一个open
success: function (data1) { if(data1.resultCode==0){ layer.msg('办结成功!', { icon: 1, time: 2000 //2秒关闭(如果不配置,默认是3秒) }, function(){ layer.close(index); location.reload(); return false; }); }else{ layer.alert("办结失败!"); } layer.close(index); }, error: function (data1) { console.log("接口异常!"); }
标签:function,index,layer,open,办结,close,data1,加载 来源: https://www.cnblogs.com/Lemon-ZYJ/p/16350252.html