ajax 如何解决错误“SCRIPT7002:XMLHttpRequest:网络错误0x80070005,访问被拒绝”。在浏览器中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29903550/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-06 10:28:13  来源:igfitidea点击:

How to solve the error "SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied." in IE

ajaxinternet-explorerconfiguration

提问by Jawadovic3814

In my web site, I created a map with ALK Maps, I display the points (Markers) and roads (routings) and all this works fine in Firefox and Chrome, but in IE I display the map and points, but when I go to the road I get the error:

在我的网站中,我使用 ALK Maps 创建了一张地图,我显示了点(标记)和道路(路线),所有这些在 Firefox 和 Chrome 中都可以正常工作,但是在 IE 中我显示了地图和点,但是当我去我得到错误的道路:

"SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied."

“SCRIPT7002:XMLHttpRequest:网络错误 0x80070005,访问被拒绝。”

? I found a solution: security area (Internet Options> Security) make ENABLE The Following setting: Miscellaneous> Access data sources across domains.

? 我找到了一个解决方案:安全区域(Int​​ernet 选项>安全)使启用以下设置:杂项>跨域访问数据源。

Is there a solution to not ask customers to my website to do this configuration?

有没有不让客户到我的网站做这个配置的解决方案?

采纳答案by Roman Canlas

I don't think it's a good idea to ask your customers to disable this configuration at all. Remember that enabling and making this change does not only apply to your website but to other websites as well.

我认为要求您的客户完全禁用此配置并不是一个好主意。请记住,启用和进行此更改不仅适用于您的网站,也适用于其他网站。

There's a huge security reason why it is disabled in Internet and Restricted Sites zones by default and it could make your customers vulnerable to different types of CORS (Cross Origin Resource Sharing) attacks

默认情况下在 Internet 和受限站点区域中禁用它有一个巨大的安全原因,它可能使您的客户容易受到不同类型的 CORS(跨源资源共享)攻击

Rather than making changes on the browser level, try to enable CORS in your client/server side code or infrastructure:

不要在浏览器级别进行更改,而是尝试在客户端/服务器端代码或基础架构中启用 CORS:

http://enable-cors.org/

http://enable-cors.org/

http://www.html5rocks.com/en/tutorials/cors/

http://www.html5rocks.com/en/tutorials/cors/

回答by Bugs Bunny

We were also running into this issue and the problem was the target URL was exceeding the maximum length of ~2,000 characters in IE11.

我们也遇到了这个问题,问题是目标URL 超过了 IE11 中约 2,000 个字符的最大长度

I agree with @user145400 that if it works in Chrome and Firefox it is very likely that CORS is already correctly enabled.

我同意@user145400,如果它在 Chrome 和 Firefox 中工作,很可能已经正确启用了 CORS。

回答by Conner

As others have mentioned, CORS came into play. In my case, IE was sending an additional header to the server (Content-Type) that the other browsers weren't, and this header wasn't allowed by my policy. Adding the header to the policy fixed the issue.

正如其他人所提到的,CORS 开始发挥作用。就我而言,IE 向服务器发送了其他浏览器没有的附加标头 (Content-Type),并且我的政策不允许此标头。将标题添加到策略修复了该问题。

回答by Dave Cole

I run into this issue when behind a SonicWall VPN at work. My solution is to add the domain to the trusted list of sites under IE's Internet Options > Security > Trusted Sites menu; this will impact Edge as well since it seems to use IE's security settings in this regard.

我在工作中使用 SonicWall VPN 时遇到了这个问题。我的解决方案是将域添加到 IE 的 Internet 选项 > 安全 > 受信任站点菜单下的受信任站点列表中;这也会影响 Edge,因为它似乎在这方面使用了 IE 的安全设置。