Bry*_*yan 59 internet-explorer cross-browser internet-explorer-8 internet-explorer-7
有没有办法使用.NET或Javascript强制IE8进入IE7兼容模式?
Ser*_*gel 86
如果您将其添加到元标记:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
Run Code Online (Sandbox Code Playgroud)
IE8将像IE7一样呈现页面.
小智 31
您可以在web.config中执行此操作
<httpProtocol>
<customHeaders>
<add name="X-UA-Compatible" value="IE=7"/>
</customHeaders>
</httpProtocol>
Run Code Online (Sandbox Code Playgroud)
对于上述解决方案,我有更好的结果.不知道为什么这不是一个解决方案.:)
Bry*_*yan 13
我现在可能已经找到了. http://blog.lroot.com/articles/the-ie7-compatibility-tag-force-ie8-to-use-the-ie7-rendering-mode/
该网站称添加此元标记:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
Run Code Online (Sandbox Code Playgroud)
或者将其添加到.htaccess
Header set X-UA-Compatible: IE=EmulateIE7
Run Code Online (Sandbox Code Playgroud)
它甚至更简单.使用HTML,您只需将此元标记添加到您的页面(页面上的第一件事):
<meta http-equiv="X-UA-Compatible" content="IE=7" />
Run Code Online (Sandbox Code Playgroud)
如果你想使用.NET来做,你只需要在标题中发送带有元信息的http请求.这需要页面刷新才能工作.
此外,您可以在此处查看类似的问题: IE8中的兼容模式使用VBScript
如果你想在IE 8标准模式下切换IE 8页面渲染,还有一个
<meta http-equiv="X-UA-Compatible" content="IE=100" /> <!-- IE8 mode -->
Run Code Online (Sandbox Code Playgroud)