简体   繁体   English

在AngularJS的IE11上拒绝访问

[英]Access is Denied on IE11 in AngularJS

Every development pipeline has 2 parts. 每个开发管道都有2个部分。 FIRST to work hard and develop the application. 首先要努力工作并开发应用程序。 SECOND to work harder and make it compatible with the great arrogant IE. 第二,努力工作,使其与出色的IE兼容。

We have an AngularJS (v1.3.13) application without any server side code developed in Webstorm . 我们有一个AngularJS (v1.3.13)应用程序,没有在Webstorm开发任何服务器端代码。 We are making REST calls to service. 我们正在进行REST服务调用。 Our application works fine on Chrome and Firefox without any Console errors. 我们的应用程序在Chrome和Firefox上运行正常,没有任何控制台错误。 However when we try to open the page in IE11 or IE9 (not tried IE10), our page doesn't load. 但是,当我们尝试在IE11或IE9中打开页面(未尝试IE10)时,我们的页面无法加载。 Console suggests we have 2 errors. 控制台提示我们有2个错误。 One of them is Access is Denied on 其中之一Access is Denied

xhr.open(method, url, true);

in angular.js . angular.js

There are number of posts on internet and none seems to be working. 互联网上的帖子数量很多,似乎都没有作用。 This is what I have tried. 这就是我尝试过的。

  1. Hosting app in IIS with changed Handler Mappings to support Cross Domain calls on an Application pool of .Net v4.0 (as suggested by a Senior) 使用更改后的处理程序映射在IIS托管应用程序,以支持.Net v4.0应用程序池上的跨域调用(由资深人员建议)
  2. Tried to disable to cache for HTTP requests. 尝试禁用缓存HTTP请求。
  3. Adding Domain in trusted site category and also adding locahost/IP to local intranet. 在受信任的站点类别中添加域,还将locahost / IP添加到本地Intranet。
  4. Changing request type to JSONP and trying to add Access-Control-Allow-Origin (with value of * ) to headers. 将请求类型更改为JSONP并尝试将Access-Control-Allow-Origin (值为* )添加到标头中。
  5. Changing IE settings to allow Cross Domain calls. 更改IE设置以允许跨域调用。

Error is still chasing us. 错误仍然在追逐着我们。 Even my colleagues have tried the same on their machines ending up with similar blow. 即使是我的同事,也曾在他们的机器上尝试过相同的操作,但结果却受到类似的打击。 Is there anyone to suggest me something on this. 有没有人给我建议呢?

It may be CORS and I may need to go for xdr (XDomainRequest) but not sure how to use it as error is in angular.js. 可能是CORS,我可能需要使用xdr(XDomainRequest),但不确定如何使用它,因为angular.js中存在错误。 I am certainly no expert on this so please suggest. 我当然不是专家,所以请提出建议。

Screen shot of the error: 错误的屏幕截图: 在此处输入图片说明

IE shows another error: [$injector:nomod] Module 'ngLocale' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.2.16/$injector/nomod?p0=ngLocale IE显示另一个错误: [$injector:nomod] Module 'ngLocale' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.2.16/$injector/nomod?p0=ngLocale [$injector:nomod] Module 'ngLocale' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.2.16/$injector/nomod?p0=ngLocale [$injector:nomod] Module 'ngLocale' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.2.16/$injector/nomod?p0=ngLocale which I am ignoring for now. [$injector:nomod] Module 'ngLocale' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.2.16/$injector/nomod?p0=ngLocale我现在忽略了。

Please suggest me something on this. 请给我一些建议。 Thanks. 谢谢。

I switched from 1.3.4 to 1.4.8 and that did the trick. 我从1.3.4切换到1.4.8,就成功了。 No more Angular Access Denied in IE (Microsoft Edge 25 2015). IE中不再拒绝Angular Access(Microsoft Edge 25 2015)。 I don't know why. 我不知道为什么

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-route.js/1.4.8/angular.min.js"></script>

Access is Denied on IE11 in AngularJS error have a solution on this link I also got the same error while downloading Image from IE11. 在AngularJS的IE11上访问被拒绝错误在此链接上有一个解决方案我从IE11下载图像时也遇到了相同的错误。 I have just added the following line in my code and It works. 我刚刚在代码中添加了以下代码,它可以正常工作。

window.navigator.msSaveBlob(blob, paramDataObject.fileName); 
or
window.navigator.msSaveOrOpenBlob(blob, paramDataObject.fileName);

Have you tried xdomain? 您是否尝试过xdomain? https://github.com/jpillora/xdomain it's a pure javascript CORS alternative. https://github.com/jpillora/xdomain,它是纯JavaScript CORS替代方案。

if (window.navigator && window.navigator.msSaveOrOpenBlob) {   
   window.navigator.msSaveOrOpenBlob(blob);
}
else {   
   var objectUrl = URL.createObjectURL(blob);    
   window.open(objectUrl);
}

Setting window.location or window.open in AngularJS gives "access is denied" in IE 11 在AngularJS中设置window.location或window.open会在IE 11中提供“访问被拒绝”

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

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