問題描述
當我第一次在 IE11 上訪問我們的網頁時,我遇到了以下錯誤.它適用于我機器上的 Chrome,但不適用于其他開發人員的機器.但是在所有情況下刷新頁面時它都有效.
I am getting below error when I visit our webpage first time on IE11. It works in Chrome on my machine but doesn't work on other developer's machine. But it works when page is refreshed in all cases.
錯誤是
SEC7118:https://secure.server.com/esi?isie789=n&_=1403623253418 需要跨域資源共享 (CORS).
SEC7118: XMLHttpRequest for https://secure.server.com/esi?isie789=n&_=1403623253418 required Cross Origin Resource Sharing (CORS).
SCRIPT7002:XMLHttpRequest:網絡錯誤 0x2ef1,由于錯誤 00002ef1,無法完成操作.SEC7127:CORS 請求的重定向被阻止.
SCRIPT7002: XMLHttpRequest: Network Error 0x2ef1, Could not complete the operation due to error 00002ef1. SEC7127: Redirect was blocked for CORS request.
它是使用 Ajax jquery 調用的.
It is being called using Ajax jquery.
$.ajax({
url: esiUrl,
type: 'GET',
data: "isie789=" + isIE789,
dataType: 'html',
cache: false,
success: function(responseText) {
if(responseText.length > 0) {
$("#deal-of-day-esi").replaceWith(responseText);
}
},
error: function() {
}
});
查看 IE11 中的請求/響應標頭 - 我沒有看到任何標頭.但是在刷新或在 Chrome、Firefox 中,我們確實看到了響應標頭低于值
Looking into to request/response headers in IE11 - I don't see any. But on refresh or in Chrome, Firefox we do see response headers with Below values
訪問控制允許憑據:true訪問控制允許來源:http://www.server.co.uk
Access-Control-Allow-Credentials:true Access-Control-Allow-Origin:http://www.server.co.uk
你能幫忙嗎?
推薦答案
我在任何地方都找不到這個文檔,但在我的測試中似乎:
I can't find this documented anywhere, but in my testing it appears that:
XMLHttpRequest:網絡錯誤 0x2ef1
XMLHttpRequest: Network Error 0x2ef1
特指混合模式錯誤;例如,當 https 站點提供重定向到 http 站點的請求時.
specifically refers to a mixed mode error; for example when an https site serves a request to redirect to an http site.
這篇關于XMLHttpRequest - SEC7127:CORS 請求的重定向被阻止的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!