如何在 IE 中禁用兼容性视图 [英] How to disable Compatibility View in IE
问题描述
我想知道您如何阻止使用 IE 8 的人进入兼容模式?
I am wondering how do you stop people who are using IE 8 from going to Compatibility mode?
<meta http-equiv="X-UA-Compatible" content="IE=8" />
我发现了这个标签,我认为这会迫使人们停留在 IE-8 模式,但我不太确定,也无法检查,因为我有 IE 9.
I found this tag and I think this forces people to stay in IE-8 mode but I am not too sure and can't check as I have IE 9.
如果人们处于 IE 9 模式,我会强迫他们不要进入 IE 8 或 IE 7 兼容模式吗?
If people are in IE 9 mode I force them to not go into IE 8 or IE 7 Compatibility mode?
我尝试将上面的行放在我的代码中,然后转到 IE 9 -> 工具 -> 兼容性视图(灰显)
I tried to put the above line in my code and went to IE 9 -> Tools -> Compatibility View(Grayed Out)
但是兼容性视图设置"没有变灰,看来您可以通过那里添加网站.
but "Compatibility View Settings" was not grayed out and it seems you could add the site through there.
那不应该禁用吗?
推荐答案
<meta http-equiv="X-UA-Compatible" content="IE=8" />
应该强制您的页面以 IE8 标准呈现.用户可以将站点添加到兼容性列表中,但此标记将优先.
should force your page to render in IE8 standards. The user may add the site to compatibility list but this tag will take precedence.
一种快速检查方法是加载页面并在地址栏中输入以下内容:
A quick way to check would be to load the page and type the following the address bar :
javascript:alert(navigator.userAgent)
如果在字符串中看到 IE7,则表示正在以兼容模式加载,否则不会.
If you see IE7 in the string, it is loading in compatibility mode, otherwise not.
这篇关于如何在 IE 中禁用兼容性视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!