XMLHttpRequest - SEC7127:CORS 请求的重定向被阻止

2023-05-14前端开发问题
2

本文介绍了XMLHttpRequest - SEC7127:CORS 请求的重定向被阻止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

限时送ChatGPT账号..

当我第一次在 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 请求的重定向被阻止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

ajax请求获取json数据并处理的实例代码
ajax请求获取json数据并处理的实例代码 $.ajax({ type: 'GET', url: 'https://localhost:44369/UserInfo/EditUserJson',//请求数据 data: json,//传递数据 //dataType:'json/text',//预计服务器返回的类型 timeout: 3000,//请求超时的时间 //回调函数传参 suc...
2024-11-22 前端开发问题
215

layui 单选框、复选框、下拉菜单不显示问题如何解决?
1. 如果是ajax嵌套了 页面, 请确保 只有最外层的页面引入了layui.css 和 layui.js ,内层页面 切记不要再次引入 2. 具体代码如下 layui.use(['form', 'upload'], function(){ var form = layui.form; form.render(); // 加入这一句});...
2024-11-09 前端开发问题
313

layui中表单会自动刷新的问题
layui中表单会自动刷新的问题,因为用到layui的表单,遇到了刷新的问题所以记录一下: script layui.use(['jquery','form','layer'], function(){ var $ = layui.jquery, layer=layui.layer, form = layui.form; form.on('submit(tijiao)', function(data){ a...
2024-10-23 前端开发问题
262

jQuery怎么动态向页面添加代码?
append() 方法在被选元素的结尾(仍然在内部)插入指定内容。 语法: $(selector).append( content ) var creatPrintList = function(data){ var innerHtml = ""; for(var i =0;i data.length;i++){ innerHtml +="li class='contentLi'"; innerHtml +="a href...
2024-10-18 前端开发问题
125

Rails 3.1 ajax:成功处理
Rails 3.1 ajax:success handling(Rails 3.1 ajax:成功处理)...
2024-04-20 前端开发问题
11

ExecJS::ProgramError: SyntaxError: 保留字“function"
ExecJS::ProgramError: SyntaxError: Reserved word quot;functionquot;(ExecJS::ProgramError: SyntaxError: 保留字“function)...
2024-04-20 前端开发问题
13