简体   繁体   English

IE11中的访问被拒绝错误

[英]Access is denied error in IE11

I am getting 'Access is denied' error with IE11 with my Angular project. 我的Angular项目收到IE11的“访问被拒绝”错误。 This works fine in Chrome. 在Chrome中可以正常使用。 I am not able to figure what is going wrong with IE as I am relatively new to web development with javascript and Angular. 我无法确定IE出了什么问题,因为我相对较不熟悉javascript和Angular的Web开发。

Can someone help me with what is going wrong with IE11 for the below code please? 有人可以帮我解决以下代码的IE11出什么问题吗?

this.http.get(url)
    .subscribe(
        res => {
            if (typeof(logInfo.callBack) === 'function') {
                logInfo.callBack(res);
            }
        }
    );

It looks like a CORS related issue. 看起来像是与CORS相关的问题。

The IE browser is using XDomainRequest which involves some limitations. IE浏览器使用的XDomainRequest涉及一些限制。 One of them is: the protocol must be preserved (requests are allowed from HTTP to HTTP, from HTTPS to HTTPS. Other protocols are prohibited). 其中之一是:必须保留协议(允许从HTTP到HTTP,从HTTPS到HTTPS的请求。禁止其他协议)。

So, if you app is loaded over 'https' but is trying to load the resource over "http" or vice versa, than the request will be blocked by IE browser. 因此,如果您的应用是通过“ https”加载的,但尝试通过“ http”加载资源,反之亦然,则该请求将被IE浏览器阻止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM