1

I have been reading up about document type emulating and compatibility mode in IE and have to say its quite a bit to get one's head around.

I have developed an App with Bootstrap 3 and Ember rendering a few pages controlled through a menu.

I tested this in all browsers, Webkit, Moz, and IE and all seemed perfect. I work in a large corporate, so when I decided to test it on some of my colleagues' computers, on IE, I got a blank page. Now I found that very strange because they were all running IE10 or IE11, although there is the odd IE9. I couldnt understand it because it renders perfectly on my IE.

So anyway, I started hitting F12 on their browsers and realised that many of them had IE7 emulating even though they were running IE10 or 11.

I read a bit about this issue, and I found the following:

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

So I proceeded to add this line to my page so it is as follow:

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

Now my question is this: Am I correct in assuming that if there was some sort of group policy set when using IE at work, that this workaround would solve the issue?

I will do some testing tomorrow morning, but just wanted to know if that is along the right lines?

Many people at work use Chrome and Firefox or whatever they want to, but there are obviously quite a few that use IE.

4

2 回答 2

1

IE 对不同类型的内容使用不同的安全区域。来自 Internet 的内容被加载到 Internet 区域。来自本地网络的内容被加载到 Intranet 区域中。如果您通过 Internet 选项,您可以看到有不同的安全设置应用于各个区域。

如果您通过网络部署应用程序,那么您的应用程序很可能会在 Intranet 区域中加载应用程序(右键单击该页面,然后选择“属性”进行确认)。

默认情况下,IE在兼容性视图中加载内网页面,这与使用EmulateIE7作为x-ua-compatible元素的内容值相同。这意味着,如果没有额外的标记/更改,您的应用程序将被视为在 IE7 中查看。

如果您需要特定的文档模式,您应该能够直接在内容值中指定该模式,例如content="ie=9". 如果这没有帮助,请尝试将 MotW 添加到页面,以便在 Internet 区域中加载页面。反过来,这应该允许 x-ua-compatible 设置生效。

您还可以更改兼容性视图设置,前提是它们没有通过 GPO 禁用,这样 Intranet 页面就不会自动加载到兼容性视图中。

希望这可以帮助...

——兰斯

于 2015-04-28T19:34:52.117 回答
1

请注意,当前组策略设置为启用兼容模式(可能是某些其他 Intranet 应用程序)并且如果您禁用它,其他应用程序可能会停止工作(或呈现不良),这一定是有原因的。如果管理员已将其配置为存在兼容性视图列表,那么您很幸运,因为您需要做的就是不将 Web 应用程序的 URL 包含到该列表中。

https://msdn.microsoft.com/en-us/library/ie/gg622935(v=vs.85).aspx

至于文档模式,我建议你改用这个:

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

将版本设置为 'IE=edge' 会告诉 Internet Explorer 使用最新的引擎来呈现页面并执行 JavaScript。

https://www.modern.ie/en-us/performance/how-to-use-x-ua-compatible

您想要“IE=EmulateIE9”的唯一原因是您的应用程序针对的是旧文档模式,在您的情况下它不是因为您使用的是最新的 Web 框架。我假设您希望为您的用户提供最佳的 UI 体验。

我了解在您的情况下,IE 版本会有所不同,并且有些版本可能不支持“IE=edge”。它会很好,因为它将回退到支持的最高文档模式。例如,IE=9、IE=Edge 或 IE=EmulateIE9 的 IE8 会导致 IE8 模式。

https://msdn.microsoft.com/en-us/library/ff405771(v=vs.85).aspx

于 2015-04-28T19:40:28.083 回答