html等待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;

$("

$("

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("上传生产数据异常!");

}

});

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值