摘要:Jquery等待ajax执行完毕再继续执行下面代码的效果,具体代码如下,其实就是将 jquery ajax 函数的 async 参数设置为 false 即可,该参数默认为 true
Jquery等待ajax执行完毕再继续执行下面代码的效果,具体代码如下,其实就是将 jquery ajax 函数的 async 参数设置为 false 即可,该参数默认为 true:
$(document).ready(function(){
loadphpernote();
window.open('//www.phpernote.com');
}); function loadphpernote(){
var url='//www.phpernote.com/ajax.php';
var data='action=list';
jQuery.ajax({
type:'post',
url:url,
data:para,
async:false,//false代表只有在等待ajax执行完毕后才执行window.open('//www.phpernote.com')语句
success:function (msg){
$('#articleList').html(msg);
}
});
}
下面给大家介绍jquery 加载等待效果
var dates = this.options.form.getWidgetByName("dates").getValue();
$.ajax({
url: "//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("上传生产数据异常!");
}
});
希望这篇文章可以帮助到你。总之,同学们,你想要的职坐标IT频道都能找到!
您输入的评论内容中包含违禁敏感词
我知道了
请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号