覆盖内网兼容模式IE8 [英] Override intranet compatibility mode IE8

查看:29
本文介绍了覆盖内网兼容模式IE8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,IE8 强制内网网站进入兼容模式.我尝试将元标头更改为 IE8,但它不承认元标头而仅使用浏览器设置.有谁知道如何禁用它?

By default IE8 forces intranet websites into compatibility mode. I tried changing the meta header to IE8, but it doesn't acknowledge the meta header and just uses the browser setting. Does anyone know how to disable this?

推荐答案

可以覆盖 Intranet 中的兼容模式.

It is possible to override the compatibility mode in intranet.

对于 IIS,只需将以下代码添加到 web.config.使用 IE9 为我工作.

For IIS, just add the below code to the web.config. Worked for me with IE9.

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

等同于 Apache:

Equivalent for Apache:

Header set X-UA-Compatible: IE=Edge

对于 nginx:

add_header "X-UA-Compatible" "IE=Edge";

对于 express.js:

And for express.js:

res.set('X-UA-Compatible', 'IE=Edge')

这篇关于覆盖内网兼容模式IE8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆