AngularJS中的IE11上的访问被拒绝

AngularJS中的IE11上的访问被拒绝

本文介绍了AngularJS中的IE11上的访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每个开发管道都有2个部分。 FIRST努力工作,开发应用程序。 SECOND努力工作,并使其与伟大的傲慢IE兼容。



我们有一个 AngularJS(v1.3.13)应用程序没有在 Webstorm 中开发的任何服务器端代码。我们正在进行 REST 调用服务。我们的应用程序在Chrome和Firefox上正常工作,没有任何控制台错误。但是,当我们尝试打开IE11或IE9(未尝试IE10)中的页面时,我们的页面不加载。控制台建议我们有2个错误。其中一个是访问被拒绝

  xhr.open ,url,true); 

angular.js



互联网上有多个帖子,似乎没有任何工作。


  1. 使用更改的处理程序映射在 IIS 中托管应用程序支持 .Net v4.0 (由高级建议)的应用程序池上的跨域调用

  2. 尝试禁用

  3. 将请求类型更改为<$ c。
  4. $ c> JSONP 并尝试添加 Access-Control-Allow-Origin (值为 *
    $ b
    错误仍在追逐我们。甚至我的同事在他们的机器上尝试了相同的结果,类似的打击。有没有人建议我在这个东西。



    这可能是CORS,我可能需要去xdr(XDomainRequest),但不知道如何使用它作为错误是在angular.js。我确实不是专家,所以请建议。



    错误的屏幕截图:



    IE显示另一个错误:
    nomod]模块'ngLocale'不可用!
    您或者拼写了模块名称或忘记加载它。
    如果注册模块,请确保指定依赖关系
    作为第二个参数。
    http://errors.angularjs.org/1.2.16/$injector/nomod?p0=ngLocale
    现在我忽略了。



    请给我建议一下。
    谢谢。

    解决方案

    我从1.3.4切换到1.4.8,不再有角度访问在I.E. (Microsoft Edge 25 2015)。我不知道为什么。

     < 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>


    Every development pipeline has 2 parts. FIRST to work hard and develop the application. SECOND to work harder and make it compatible with the great arrogant IE.

    We have an AngularJS (v1.3.13) application without any server side code developed in Webstorm. We are making REST calls to service. Our application works fine on Chrome and Firefox without any Console errors. However when we try to open the page in IE11 or IE9 (not tried IE10), our page doesn't load. Console suggests we have 2 errors. One of them is Access is Denied on

    xhr.open(method, url, true);
    

    in 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)
    2. Tried to disable to cache for HTTP requests.
    3. Adding Domain in trusted site category and also adding locahost/IP to local intranet.
    4. Changing request type to JSONP and trying to add Access-Control-Allow-Origin (with value of *) to headers.
    5. Changing IE settings to allow Cross Domain calls.

    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. 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 which I am ignoring for now.

    Please suggest me something on this.Thanks.

    解决方案

    I switched from 1.3.4 to 1.4.8 and that did the trick. No more Angular Access Denied in I.E. (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>
    

    这篇关于AngularJS中的IE11上的访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 13:27