2014-04-15 132 views
0

之間存在着什麼樣的錯誤信息從JQuery的AJAX調用獲得在Firefox和IE11相當的差異:JQuery的:IE11 AJAX錯誤處理程序不給錯誤信息

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){ 
     // ... 
    } 
}); 

這是怎麼回事錯在這裏?

+0

什麼版本的jQuery? –

+0

使用jQuery v1.10.2 – Jodes

+0

如果使用失敗而不是錯誤會發生什麼?在jQuery 1.8中不贊成錯誤,成功和完整。 –

回答