ajax 的$.post和$.get同步的方法

在ajax方法前加$.ajaxSettings.async = false;
在ajax方法后加$.ajaxSettings.async = true;

如:

    $.ajaxSettings.async = false;
    $.post("", data, function(result) {
        
     },"json");
    $.ajaxSettings.async = true;

猜你喜欢

转载自www.cnblogs.com/yang1018/p/11078789.html