XMLHtt prequest:网络错误0X80070005,访问被微软边缘(但不是IE)否认微软、边缘、错误、不是

2023-09-10 17:34:02 作者:真心喜欢过的人没法做朋友

我有一个非常简单的Ajax请求(见下文)。该服务器使用CORS和在IE 10+,Chrome浏览器,Firefox和Opera 工作正常。在微软边线的但是,它无法与

I have a very simple ajax request (see below). The server is using CORS and works fine in IE 10+, Chrome, Firefox and Opera. On Microsoft Edge however, it fails with

XMLHtt prequest:网络错误0X80070005,访问被拒绝

XMLHttpRequest: Network Error 0x80070005, Access is denied.

我研究的职位here, here, here和here,但无法找到问题的解答。这些人有问题与IE浏览器,但加入的contentType(不需要这个GET)和跨域有它工作的罚款。

I have researched the posts here, here, here and here, but cannot find an answer that works. Those people have had issues with IE, but adding the contentType (not required for this get) and crossDomain has it working fine.

CanIUse 似乎指出,CORS是在边缘使用。该请求也没有对IE9下来,但CanIUse国CORS只是部分支持,所以这是可以理解的。

CanIUse seems to state that CORS is usable in Edge. The request also fails on IE9 down, but CanIUse states only partial support for CORS, so that's understandable.

任何想法如何,我可以解决这个问题吗?

Any ideas how I can fix this please?

code:

$.ajax({
      crossDomain: true,
      url: "http://localhost:2023/api/DoAction/test",
      success: function (a) {
        var res = JSON.parse(a);
        alert(res.content);
      },
      error: function (a, e, r) {
        alert(a.responseText);
      }
    });

更新

要添加的情况下提供任何线索的详细信息 - Ajax请求从Azure和发布使用OWIN自主机创建来本地主机的网站。这是不寻常的,但所需的软件(它只能在本地使用)从云服务获取数据。如前所述,它工作正常,所有其他的浏览器,Edge是唯一的问题。

To add further information in case it provides any clues - the ajax request is coming from Azure and posting to a localhost website created using OWIN self hosting. This is unusual, but required for the software (which can only be used locally) to get data from a cloud service. As stated, it works fine for all other browsers, Edge is the only problem.

推荐答案

微软边缘没有的现在的支持(开箱即用)本地主机测试。 HTTP:您可以按照这里提供的指导,但是启用//dev.modern.ie/platform/faq/how-can-i-debug-localhost/ 。

Microsoft Edge does not currently support (out of the box) localhost testing. You can however enable it by following the guidance provided here: http://dev.modern.ie/platform/faq/how-can-i-debug-localhost/.

我们正在努力在未来的版本解决这一点。

We're working on resolving this in a future release.

 
精彩推荐
图片推荐