jQuery ajax 响应在 IE11 中不起作用
jQuery ajax response not working in IE11
我正在尝试使用 jQuery/AJAX 创建登录页面,我的代码在其他浏览器中运行良好,但我在 IE11 中遇到问题。
IE11 抛出异常
SCRIPT7002: XMLHttpRequest: Network Error 0x800c0008, The download of the specified resource has failed.
代码
$.ajax({
type: 'post',
url: $('#form-login').attr('action'),
data: $('#form-login').serialize(),
success: function (data) {
if (isJson(data)) {
...
}
},
complete: function (data) {
console.log(data);
if (data.status == 302) {
location.href = data.responseText;
}
}
});`
似乎只有 302(重定向响应)有问题,我将其更改为 203,一切正常。
我正在尝试使用 jQuery/AJAX 创建登录页面,我的代码在其他浏览器中运行良好,但我在 IE11 中遇到问题。 IE11 抛出异常
SCRIPT7002: XMLHttpRequest: Network Error 0x800c0008, The download of the specified resource has failed.
代码
$.ajax({
type: 'post',
url: $('#form-login').attr('action'),
data: $('#form-login').serialize(),
success: function (data) {
if (isJson(data)) {
...
}
},
complete: function (data) {
console.log(data);
if (data.status == 302) {
location.href = data.responseText;
}
}
});`
似乎只有 302(重定向响应)有问题,我将其更改为 203,一切正常。