From:https://blog.csdn.net/winy_lm/article/details/60959751
ajax async设为false即同步调用
//去支付
function gotoPay(param) {
$.ajax({
type: "post",
url: "/xxxx/xxxx",
async: false,// 只加了个同步
data: {"param": param},
error: function (data) {
showError(data);
},
success: function (data) {
window.open("b.html");//
}
});
}
From:https://www.cnblogs.com/xuejianxiyang/p/9675178.html