Steven5007

导航

ajax 请求问题

1.ajax 请求锁定页面加载  (加载-异步-关闭-弹框)

   function  agree(id,index){
           var yj=$("#taskTableId tr[data-index='"+index+"']").find("td a[data-name='appComment']").html();
           if( yj=="" || yj=="undefined" || yj==" "){
               alert("请先填写审批意见!");
               return;
           }
       layer.load(0, {shade: [0.1,'#D4D4D4'] });
           $.ajax({
               type:'post',
       //  async:false, //layui.load()在ajax使用时,ajax必须是异步模式,不然layui.load()不起作用。 url:
'taskAgentsController/processPass.json', data:{"id":id,"yj":yj}, success : function(result) { layer.closeAll('loading'); layer.alert(result.ajaxResultJson.msg); $("#taskTableId").bootstrapTable('refresh'); }, error : function(e){ layer.closeAll('loading'); alert("系统异常!"); } }); }

2. ajax请求成功,跳转新页面

window.open(url)
var new_window = window.open();
new_window.location ="url"
new_window.close();

 

posted on 2019-01-23 15:44  Steven5007  阅读(121)  评论(0编辑  收藏  举报