IE8中有“Internet Explorer 8”、“Internet Explorer 8兼容模式”、“IE7模式”。
然而,IE 中的默认设置使所有内网网站都使用“IE8 兼容模式”,即使我已经按照建议设置了 doctype、meta 标记、http 标头以强制其进入 IE8 模式。
我有
http://www.w3.org/TR/html4/loose.dtd">
和
但仍然进入“IE8兼容模式”,IE设置没有任何变化。
如何强制它进入纯“IE8”模式,而不改变任何浏览器的设置?
附言。我这里不是在谈论“文档模式”。
There are "Internet Explorer 8", "Internet Explorer 8 Compatibility Mode", and IE7 mode in IE8.
However, the default setting in IE make all intranet website use "IE8 Compatibility Mode" even I have setted doctype, the meta tag, http header as suggested to force it into IE8 mode.
I have
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
and
<meta http-equiv="X-UA-Compatible" content="IE=8" >
But it still goes into "IE8 Compatibility Mode", without any changes in IE setting.
How to force it into pure "IE8" mode, without change any browser's setting?
PS. I am not talking "document mode" here.
发布评论
评论(13)
看来MSFT没有考虑一个大型的内部网环境,我们里面运行着许多不同的Web应用程序。
根据我在 MSDN 论坛上读到的内容,没有办法绕过 IE8 设置。
因此,我将不得不请求我的系统管理员设置一些新的组策略来更改“兼容性视图”设置和值并阻止用户更改该值,直到 MSFT 发现此错误并修复它。
来自 MSDN 博客文章(强调他们的):“在 IE 请求网页内容之前选择浏览器模式。这意味着网站无法选择浏览器模式< /强>。”
Seem that MSFT has not consider a large intranet environment that we have many different web application running inside.
There is no way to bypass the IE8 setting, according to somewhere I read on MSDN forum.
So, I will have to beg my system administrators to put some new group policies to change "Compatibility View" setting and the value and prevent user change the value, until MSFT discover this bug and fix it.
From an MSDN blog post (emphasis theirs): "Browser Mode is chosen before IE requests web content. This means that sites cannot choose a Browser Mode."
可以覆盖 Intranet 中的兼容模式。只需将以下代码添加到 web.config 中即可。为我工作,使用 IE9。
It is possible to override the compatibility mode in intranet. Just add the below code to the web.config. Worked for me with IE9.
您必须对 IE 进行一些调整。
它们在这里......
在“Internet 选项”/“本地 Intranet”/“站点”
下:“站点内的本地 Intranet”下,取消选中“自动检测 Intranet 网络”。
然后仅选择“包括所有网络路径(UNC)”
请参阅随附的屏幕截图
You'll have to make some adjustments to IE.
Here they are.....
In Internet Options / Local Intranet / Sites
Under : Local Intranet inside Sites, uncheck "Automatically detect intranet network".
Then select only "Include all network paths (UNCs)
See attached screenshots
我发现这里的答案很难理解,因此简而言之,这是重要信息:
如果您的 Intranet 使用 IE 的默认设置,则无论网站设置如何,都会对 Intranet 站点强制执行 IE7 标准模式。
来自此:
I found the answers here hard to follow, so here's the important information in a nutshell:
If your intranet uses default settings for IE, IE7 Standards Mode is enforced for intranet sites regardless of any website settings.
From this:
要覆盖 Intranet 或所有网站的兼容性视图设置,您需要让 IE8 模拟自身。
To override the Compatibility View settings for intranet or all websites you need to make IE8 emulate itself.
设置自定义 HTTP 标头,而不是使用。这些应该是等效的,但我已经看到来自服务器的
部分中的
X-UA-Compatible
HTTP 标头将覆盖 IE 8 的“在兼容性视图中显示 Intranet 站点”设置,其中< ;meta...
元素不会。Set a custom HTTP header instead of using the
<meta...
in the<head>
section. These are supposed to be equivalent, but I have seen that anX-UA-Compatible
HTTP header from the server will override IE 8's "Display intranet sites in Compatibility View" setting, where the<meta...
element would not.如果您使用 .NET,我可以为您提供答案:
HTML:
Web.Config:
If you are using .NET, I have the answer for you:
HTML:
Web.Config:
在某处读到 DOCTYPE 声明必须是第一行。没有任何类型的注释,也没有空行。
结合设置 HTTP 响应标头,这对我有用。
浏览器模式
从“IE9兼容模式”变为“IE9模式”。Read somewhere that the DOCTYPE declaration must be the very first line. No comments of any kind, nor empty lines.
In combination with setting the HTTP Response Headers, this worked for me.
Browser Mode
went from "IE9 Compatibility Mode" to just "IE9 Mode".HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\BrowserEmulation
内联网兼容模式 1-->0
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\BrowserEmulation
IntranetCompatibilityMode 1-->0
为了使 META 声明起作用,文档类型必须是简化版本:
而不是丹尼斯问题中较长的语句。
In order for the META declaration to work, the doctype has to be the simplified version:
Not the longer statement in Dennis' question.
这个组合对我来说很有效:
至少 IE 开发工具报告了 IE9 兼容视图,IE8 标准
只是为了让我尝试 EmulateIE7 并且也有效。
简化扩展的 !DOCTYPE 是关键。
This combo did the trick for me:
at least IE developer tools reports IE9 Compat View, IE8 standards
just for kicks i tried EmulateIE7 and that worked as well.
simplifying the extended !DOCTYPE was key.
您需要从您的域名站点名称中删除端口号
site:1180/index/
如果浏览器在 url 中看到端口号 - 你好“认为”,那就是 Intranet。
设置您的 dns 服务器以获取友好的网址 - site.com/index 并且工作正常
You need remove port number from your domain site name
site:1180/index/
If browser see port number in url - hi "think", that's is intranet.
setup your dns server for friendly urls - site.com/index and it work OK
标记为“正确”的答案在技术上是正确的,但表明大多数人面临的真正问题没有解决方案,即:“如何在启用兼容模式的 IE8 上正确显示不支持的 Web 应用程序兼容模式?”。
这对我的几个工作站都有效。
如果上述代码在应用程序端实现,则 IE8 的行为看起来就像未处于兼容模式一样,尽管它仍将浏览器模式显示为兼容模式。
The answer marked as "correct" is technically correct but suggests that there is no solution to the real issue being faced by most people that is: "how do I properly show on IE8, with compatibility mode enabled, a web application which does not support compatibility mode?".
this worked for me on several workstations.
If the above code is implemented on application side, IE8 appears to behave as if it was not in compatibility mode, even though it will still show browser mode as compatibility mode.