前两天遇到一个jquery aiax 的问题,下面的这个方法在ie中可以运行,chrome 中运行就报错。
$.ajax({
type: "post",
url: "../app/coupon.ashx",
cache: false,
data: "vstockcode=" + $('#ContentPlaceHolder1_vstockcode').val() + "&sbb=" + sbb,
success: function (data) {
if (data == "") {
alert("兑换成功!");
window.location.href = "youhui.aspx";
} else {
alert(data);
}
},
error: function () {
alert("怎么出错了呢");
}
});
网上搜了很久 终于找到解决办法 添加 async:false。
具体啥原因 还不晓得 欢迎牛人指点
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22392018/viewspace-1101461/
,如需转载,请注明出处,否则将追究法律责任。