AutoCAD 3DMAX C语言 Pro/E UG JAVA编程 PHP编程 Maya动画 Matlab应用 Android
Photoshop Word Excel flash VB编程 VC编程 Coreldraw SolidWorks A Designer Unity3D
 首页 > JavaScript

Jquery ajax加载等待执行结束再继续执行下面代码操作

51自学网 http://www.wanshiok.com
jquery_ajax加载等待, jquery_ajax等待

Jquery等待ajax执行完毕再继续执行下面代码的效果,具体代码如下,其实就是将 jquery ajax 函数的 async 参数设置为 false 即可,该参数默认为 true:

$(document).ready(function(){   loadphpernote();   window.open('http://www.phpernote.com'); }); function loadphpernote(){   var url='http://www.phpernote.com/ajax.php';   var data='action=list';   jQuery.ajax({     type:'post',     url:url,     data:para,     async:false,//false代表只有在等待ajax执行完毕后才执行window.open('http://www.phpernote.com')语句     success:function (msg){       $('#articleList').html(msg);     }   }); } 

  下面给大家介绍jquery 加载等待效果

 var dates = this.options.form.getWidgetByName("dates").getValue();  $.ajax({    url: "http://127.0.0.1:9009/Brilliantzz/service/snproduct.do",    data:dates, beforeSend:function() {    var h = document.body.clientHeight;   $("<div class=/"datagrid-mask/"></div>").css({display:"block",width:"100%",height:h}).appendTo("body");   $("<div class=/"datagrid-mask-msg/"></div>").html("正在上传生产数据,请稍候。。。").appendTo("body").css({display:"block",  left:($(document.body).outerWidth(true) - 190) / 2,  top:(h - 45) / 2});   }, complete:function(data) {      $('.datagrid-mask-msg').remove();   $('.datagrid-mask').remove();   },   success: function(data) {     alert("生产数据:"+data);     },   error: function(data) {        alert("上传生产数据异常!");       }     }); 

jquery_ajax加载等待, jquery_ajax等待  
上一篇:jQuery插件实现无缝滚动特效  下一篇:谈谈encodeURI和encodeURIComponent以及escape的区别与应用