問題描述
SCRIPT7002:XMLHttpRequest:網(wǎng)絡(luò)錯誤 0x2ef3,無法完成由于錯誤 00002ef3 導(dǎo)致的操作
SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3
目前沒有有效的解決方案.
更新:在 IE11 上也注意到了.
Update: Noticed on IE11 also.
經(jīng)過越來越多的調(diào)查,我得出了這個結(jié)果:
After more and more investigation, I come with this results:
- 這個問題是我的應(yīng)用程序特有的,它不會發(fā)生在 facebook 上.
- 這個問題與每個主機的最大請求數(shù)無關(guān)(我做了淹沒服務(wù)器的示例頁面,IE10 能夠同時處理多達(dá) 8-10 個請求,在我的應(yīng)用程序中我也嘗試過這樣做ajax 請求串行,它也失敗了).
- 問題是 POST 請求特有的.
- 問題不是特定于所使用的 JS 庫(我嘗試從控制臺直接 XMLHttpRequest 也失敗了).
- xhr.send(), xhr.readyState = 4 和 xhr.onreadystatechange 觸發(fā)后失敗.
- 失敗與任何內(nèi)容類型、正確的請求或服務(wù)器配置無關(guān).它只是客戶端,請求虛擬頁面會失敗,只有最低 XHR,只有 xhr.open 和 xhr.send.
- 主要發(fā)生在清除瀏覽器緩存后.
- 在 POST 之前執(zhí)行 GET 請求并不能解決此問題.
我的問題是:
- 瀏覽器緩存如何影響 POST ajax 請求?
- 是否有任何機構(gòu)與 IE 開發(fā)人員聯(lián)系,告訴我們此錯誤網(wǎng)絡(luò)錯誤 0x2ef3"映射到什么?
目前我正在做的臨時解決方案是,如果 HTTP 狀態(tài)代碼為零,則最多重試 3 次.但這很丑陋,因為有時甚至上傳請求都會失敗,并且對于那些有重試的請求會變得很慢,有時會花費額外的100ms.
For now the temporary solution I am doing is simply retry for a max 3 times if the HTTP status code was zero. But it is very ugly because even upload requests sometimes failed, and it become slow for those requests with retry, sometimes it will take extra 100ms.
重現(xiàn)步驟:
- 確保 fiddler 或代理已禁用.
- http://ie10.laiths.name/#!login
- 打開 IE10 控制臺,刪除瀏覽器緩存.
- 試試這個無效的登錄:random@rand.com/random
- 3-4 次(清除緩存/無效登錄)后,您將看到此錯誤:SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, 由于錯誤 00002ef3 無法完成操作.
我的 IE 版本:
- Win7 IE10 版本:10.0.9200.16618
- 更新版本:10.0.6 (KB2838727)
如果 瀏覽器是 IE10
&&,現(xiàn)在我最多重試 3 次來解決它請求是POST
&&HTTP 狀態(tài)碼為 0
.
For now I am solving it by retrying a max of 3 times if the browser is IE10
&& Request is POST
&& HTTP status code is 0
.
如果有人可以幫助我刪除我丑陋的解決方案,我將不勝感激,因為使用這樣的解決方案,即使請求發(fā)送到服務(wù)器并返回 0,我也會重試(我試圖通過測量之間的時間來避免這種情況xhr.send 及其回調(diào),但它不可靠),如果 IE10 在 comptMode 下怎么辦,如果 IE11 有同樣的問題怎么辦,再加上該性能,每次重試之間將在我的機器上花費約 170 毫秒.
I would appreciate if somebody can help me to remove my ugly solution, because with such solution even if the the request goes to the server and it returns 0 I will also retry (I was trying to avoid that by measuring the time between xhr.send and its callback but it is not reliable), what about if IE10 in comptMode, what about if IE11 has same problem, add to that performance, it will take on my machine ~170ms between each retry.
推薦答案
這可能是由于安全證書問題而發(fā)生的.如果您清除緩存,您會丟失部分(如果不是全部)證書信息.
This can be happening due a security certificate issue. If you clear the cache you loose part (if not all) of certificate information.
您可以在 http://www.jonnyreeves.co.uk/2013/making-xhr-request-to-https-domains-with-winjs/
基本上它說您必須在您的 POST 請求之前執(zhí)行 GET 才能更新證書信息.
Basically it says you must do a GET before your POST request in order to update the certificate information.
這篇關(guān)于IE10/IE11 Abort Post Ajax 請求在清除緩存后出現(xiàn)錯誤“網(wǎng)絡(luò)錯誤 0x2ef3"的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!