本文介绍了覆盖Intranet兼容模式IE8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
默认情况下,IE8会强制Intranet网站进入兼容模式。我尝试将元标题更改为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')
这篇关于覆盖Intranet兼容模式IE8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!