ajax 同步

百度上说async:false,就是同步了。测试后发现不是


结果还是返回 1.

关键方法来了:
jQuery.ajax({
async:false,
url:"Handler1.ashx",
//type:"post",
success:function(msg){
value = msg;
}
}).done(function(msg){
value = msg;
});

加个done才是真正的同步。返回后台数据

posted on 2018-11-20 11:59  wolf12  阅读(124)  评论(0)    收藏  举报