首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >JQuery: IE11 AJAX错误处理程序未提供错误信息

JQuery: IE11 AJAX错误处理程序未提供错误信息
EN

Stack Overflow用户
提问于 2014-04-15 22:08:40
回答 1查看 971关注 0票数 0

在火狐和IE11中,JQuery从AJAX调用中获得的错误信息有很大的差异:

代码语言:javascript
复制
ajaxData = {id: 1234, quantity: 3};
$.ajax({
    type: 'POST',
    url: BASE_URL + 'ajax/this-page-does-not-exist.php',
    dataType: 'json',
    data: ajaxData,
    error: function(xhr, textStatus, errorThrown){
        // in Firefox:
        //  - xhr.responseText has the "Not found" HTML message returned by the server
        //  - xhr.status is 404
        //  - textStatus is 'error'
        //  - errorThrown is 'Not Found'
        // in IE11:
        //  - xhr.responseText is empty
        //  - xhr.status is 0
        //  - textStatus is 'error'
        //  - errorThrown is empty

    },
    success: function(data, textStatus, xhr){
        // ...
    }
});

这里出了什么问题?

EN

回答 1

Stack Overflow用户

发布于 2014-05-28 12:05:45

这可能和我在这里问的是一样的:

IE11 returns status 0 during Ajax POST operation from an iFrame (XMLHttpRequest: Network Error 0x2ee4)

微软表示,他们将调查这个问题。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23086185

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档