1、layer.msg 添加回调函数
//1.5秒跳转(如果不配置,默认是3秒)
layer.msg(response.msg,{time: 2000},function(){
window.location.href = "{:url('articleCat/index')}";
});
2、js提交formdata
var formData = new FormData(document.getElementById("myform"));
$.ajax({
url:"{:url('articleCat/save')}",
type:"post",
data:formData,
processData: false,
contentType: false,
dataType:"json",
success:function(response){
if(response.code == 200){
//1.5秒跳转(如果不配置,默认是3秒)
layer.msg(response.msg,{time: 2000},function(){
window.location.href = "{:url('articleCat/index')}";
});
}else{
layer.msg(response.msg);
}
}
});