弹框页面点击提交后关闭并刷新首页

问题:在主页面点击按钮弹出弹框页面,在弹出页面点击提交按钮后关闭当前弹框页面,并刷新主页面

 1 //在弹出页面中通过js执行提交操作
 2 function submit(vId,id){
 3      debugger;
 4     layer.confirm("确定提交吗?",function (index){
 5         $.ajax({
 6             url:"${ctx}/vehicleRegulation/carSure/"+vId+"/"+id,
 7             dataType:'json',
 8             success:function(rst){
 9                 if(rst.statusCode=='200'){
10                     var loadingIndex = Dialog.load();
11                     debugger;
12                //提交成功后,执行 $("#vehiForm").submit();vehiForm为主页面查询form,相当于执行了一次不带查询条件的查询
13                     top.layer.msg("提交成功!", {icon : 1});
14                     $.ajaxSettings.async = false;
15                     $("#vehiForm").submit();
16                     layer.closeAll();
17                     $.ajaxSettings.async = true;
18                 }else{
19                     top.layer.msg("提交失败!", {icon : 2});
20                 }
21             }
22         });
23     })
24 }     

猜你喜欢

转载自www.cnblogs.com/zeevy/p/12550066.html