简体   繁体   English

AngularJS的IE-Edge兼容模式问题

[英]IE-Edge Compatible mode issue with AngularJS

My AngularJS Web application is working fine in dev environment as expected once its deployed to higher environment . 一旦将其部署到更高的环境,我的AngularJS Web应用程序就可以在开发环境中正常工作。 While running/browsing the application in IE Edge the application by default selecting the 8 and my application is not working since IE 8 wont support AngularJS. 在IE Edge中运行/浏览应用程序时,默认情况下,该应用程序选择8,而我的应用程序无法运行,因为IE 8将不支持AngularJS。

So tried changing the meta tag to override the compatible view setting in my code as follows 所以尝试更改meta标签以覆盖我的代码中的兼容视图设置,如下所示

Trial 1 试验1

 <!DOCTYPE html> 
    <html> 
      <head> 
        <meta http-equiv="X-UA-Compatible" content="IE=edge">  

Here in the place of the content I tried with all possible options like 在这里,我尝试使用所有可能的选项代替内容
IE=edge,11,EmulateIE11,10,EmulateIE10,9,EmulateIE9 IE =边缘,11,EmulateIE11,10,EmulateIE10,9,EmulateIE9

Trial 2 试用2

 <system.webServer>
     <httpProtocol>
        <customHeaders>
           <add name="X-UA-Compatible" value="IE=edge" />
        </customHeaders>
     </httpProtocol>
  </system.webServer> 

I tried in all possible ways but while browsing the application by default it is selecting the IE mode 8 and application not working. 我尝试了所有可能的方式,但是在默认情况下浏览应用程序时,它选择的是IE模式8,并且应用程序无法正常工作。

Note: It's an intranet site with compatible settings enabled in IE. 注意:这是一个Intranet网站,在IE中启用了兼容设置。 Before upgrading to IE from 10 to 11, the application was up and running correctly without any override compatibility code. 从10升级到IE 11之前,该应用程序已启动并正常运行,没有任何替代兼容性代码。

My hosted environment has compatible view settings by default so am trying to override default setting by above trials but no luck. 我的托管环境默认情况下具有兼容的视图设置,因此我尝试通过上述尝试覆盖默认设置,但没有运气。 In the Fiddler HTTP response header I can see the X-UA-Compatible edge and in view source I can see: 在Fiddler HTTP响应标头中,我可以看到与X-UA兼容的边缘,在视图源中,我可以看到:

<html> 
  <head> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

FYI https://github.com/MicrosoftEdge/MicrosoftEdgeLauncher/issues/14 仅供参考https://github.com/MicrosoftEdge/MicrosoftEdgeLauncher/issues/14

I was experiencing this issue yesterday. 我昨天遇到这个问题。 Browsed about it for quite sometime why it was occurring. 在一段时间内浏览了它的发生原因。 It worked good when tested with my localhost application server, but when I moved it to the server machine for intranet access, it started getting distorted in IE. 在我的localhost应用程序服务器上进行测试时,它运行良好,但是当我将其移至用于Intranet访问的服务器计算机时,它在IE中开始失真。 I realized that whenever IE is being launched, it's launched in compatibility mode IE7 by default for all the intranet pages. 我意识到,无论何时启动IE,默认情况下,所有Intranet页面都以兼容模式IE7启动。

Tried with <meta http-equiv="X-UA-Compatible" content="IE=edge"> as the first meta tag and it worked for me. 尝试使用<meta http-equiv="X-UA-Compatible" content="IE=edge">作为第一个元标记,它对我有用。

I am glad to see that you got it worked out by getting the group policy settings updated. 我很高兴看到您通过更新组策略设置来解决问题。

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

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