IE 兼容模式:'X-UA-Compatible' 标签 'Edge' [英] IE Compatibility Mode: 'X-UA-Compatible' tag 'Edge'

查看:30
本文介绍了IE 兼容模式:'X-UA-Compatible' 标签 'Edge'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 中有这个:

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

它会强制 IE 使用最新的渲染模式,但兼容模式被认为是最后一种吗?

It will force the latest rendering mode for IE, but is Compatibility Mode considered the last one?

我的意思是,例如:将此代码与 IE8 一起使用,会强制它使用 IE8 或 IE8 兼容模式吗?

I mean, for example: using this code with IE8, it will force it to use IE8 or IE8 Compatibility Mode?

推荐答案

该标签将尝试强制浏览器使用浏览器支持的最新渲染模式.它不会触发兼容模式.

That tag will try to force the browser to use the latest rendering mode the browser supports. It will not trigger Compatibility mode.

请注意,标签必须是头部的第一个标签,否则将不起作用.这个事实有利于尽可能使用 HTTP 标头,因为 HTTP 标头中的顺序无关紧要.

Note that the tag has to be the first tag in the head or it will not work. This fact favors using HTTP headers if possible as the order in the HTTP headers does not matter.

如果在您使用标头或元标记时浏览器仍以兼容模式结束,原因之一可能是:

If the browser stills ends up in Compatibility mode when you use a header or the meta tag one of these things is likely the cause:

  • 你缺少一个理智的文档类型
  • 浏览器已设置为始终使用兼容模式
  • 该站点托管在内联网站点"上,并且已设置内联网站点的默认设置

更改浏览器兼容性视图设置

Microsoft 认为至少 192.168.x.x 位于Intranet 站点"上.IE8/IE9 内网站点默认使用兼容模式.对于许多业务应用程序来说,这是一个大问题,因为即使使用此元标记,程序员也无法覆盖此选项.(在兼容性视图中显示 Intranet 站点"不能被元标记或 http 标头覆盖 - 在这种情况下,浏览器完全控制兼容性视图)

Microsoft considers at least 192.168.x.x to be on a "Intranet site". The default for intranet sites in IE8/IE9 is to use compatibility mode. That's a huge issue for many business applications as the programmer CANNOT override this option even with this meta tag. ("Display intranet sites in Compatitiblity View" is not overridable by meta tag or http header - the browser is in complete control of compatibility view in this case)

始终添加此元标记或 http 标头?

使用此元标记的另一个好处是兼容性视图"图标已从浏览器的地址栏中删除.至少您的用户无法使用该按钮决定渲染模式.

One more good thing about using this meta tag is that the "compatibilty view" icon is removed from the address bar of the browser. At least your users can then not decide the render mode using that button.

这篇关于IE 兼容模式:'X-UA-Compatible' 标签 'Edge'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆