强制“Internet Explorer 8”内网浏览器模式

发布于 2024-08-31 01:00:44 字数 448 浏览 1 评论 0 原文

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(13

失眠症患者 2024-09-07 01:00:44

看来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."

左秋 2024-09-07 01:00:44

可以覆盖 Intranet 中的兼容模式。只需将以下代码添加到 web.config 中即可。为我工作,使用 IE9。

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

It is possible to override the compatibility mode in intranet. 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>

俯瞰星空 2024-09-07 01:00:44

您必须对 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

Screenshot

呢古 2024-09-07 01:00:44

我发现这里的答案很难理解,因此简而言之,这是重要信息:

如果您的 Intranet 使用 IE 的默认设置,则无论网站设置如何,都会对 Intranet 站点强制执行 IE7 标准模式。

来自

兼容性视图和企业

大量业务线
网站是 Internet Explorer 7
今天有能力。为了保存
兼容性、Internet Explorer 8
附带基于智能默认值
区域评价。在默认状态下,
公共互联网上的所有网站
在 Internet Explorer 8 中显示
标准模式(兼容性视图
关闭)和所有 Intranet 网站
在 Internet Explorer 7 中显示
标准模式
(兼容性视图
上)。

让我们看一些例子。如果你
导航到您本地的网站
内联网,如 http://myPortal 和
http://sharepoint/sites/mySite,
Internet Explorer 8 使用用户代理字符串来标识自身
'7','7'的版本向量
,以及
显示触发的网页
Internet Explorer 7 中的标准模式
标准模式。这个组合
允许网页正常工作
在 Internet Explorer 7 中继续
在 IE8 中执行此操作。

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:

Compatibility View and the Enterprise

A large number of line-of-business
websites are Internet Explorer 7
capable today. In order to preserve
compatibility, Internet Explorer 8
ships with smart defaults based on
zone evaluation. In the default state,
all sites on the public internet
display in Internet Explorer 8
Standards mode (Compatibility View
off) and all intranet websites
display in Internet Explorer 7
Standards mode
(Compatibility View
on).

Let’s look at some examples. If you
navigate to sites on your local
intranet like http://myPortal and
http://sharepoint/sites/mySite,
Internet Explorer 8 identifies itself with a User Agent string of
‘7’, Version Vector of ‘7’
, and
displays webpages that trigger
standards mode in Internet Explorer 7
Standards mode. This combination
allows webpages that worked correctly
in Internet Explorer 7 to continue to
do so in IE8.

素手挽清风 2024-09-07 01:00:44

要覆盖 Intranet 或所有网站的兼容性视图设置,您需要让 IE8 模拟自身。

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >

To override the Compatibility View settings for intranet or all websites you need to make IE8 emulate itself.

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >
优雅的叶子 2024-09-07 01:00:44

设置自定义 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 an X-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.

柳絮泡泡 2024-09-07 01:00:44

如果您使用 .NET,我可以为您提供答案:

HTML

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=8" >

Web.Config:

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

If you are using .NET, I have the answer for you:

HTML:

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=8" >

Web.Config:

<system.webServer>
    <httpProtocol>
      <customHeaders>
        <clear />
        <add name="X-UA-Compatible" value="IE=8" />
      </customHeaders>
    </httpProtocol>
迷途知返 2024-09-07 01:00:44

在某处读到 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".

喜爱纠缠 2024-09-07 01:00:44

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\BrowserEmulation
内联网兼容模式 1-->0

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\BrowserEmulation
IntranetCompatibilityMode 1-->0

逆光飞翔i 2024-09-07 01:00:44

为了使 META 声明起作用,文档类型必须是简化版本:

<!DOCTYPE html>

而不是丹尼斯问题中较长的语句。

In order for the META declaration to work, the doctype has to be the simplified version:

<!DOCTYPE html>

Not the longer statement in Dennis' question.

故事还在继续 2024-09-07 01:00:44

这个组合对我来说很有效:

<!DOCTYPE HTML>
<HEAD>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >
</HEAD>

至少 IE 开发工具报告了 IE9 兼容视图,IE8 标准

只是为了让我尝试 EmulateIE7 并且也有效。
简化扩展的 !DOCTYPE 是关键。

This combo did the trick for me:

<!DOCTYPE HTML>
<HEAD>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >
</HEAD>

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.

财迷小姐 2024-09-07 01:00:44

您需要从您的域名站点名称中删除端口号
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

晨敛清荷 2024-09-07 01:00:44

标记为“正确”的答案在技术上是正确的,但表明大多数人面临的真正问题没有解决方案,即:“如何在启用兼容模式的 IE8 上正确显示不支持的 Web 应用程序兼容模式?”。

<!DOCTYPE HTML>
<HEAD>
    <meta http-equiv="X-UA-Compatible" content="Edge" >
</HEAD>

这对我的几个工作站都有效。

如果上述代码在应用程序端实现,则 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?".

<!DOCTYPE HTML>
<HEAD>
    <meta http-equiv="X-UA-Compatible" content="Edge" >
</HEAD>

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文