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

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

问题描述

我在< head> 中有这个:

  < meta http-equiv =X-UA-Compatiblecontent =IE = Edge/> 

它会强制IE的最新渲染模式,但兼容模式被认为是最后一个? p>

我的意思是,例如:使用这个代码与IE8,它会强制它使用IE8或IE8兼容模式?

解决方案

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



请注意,标记必须是头中的第一个标记,否则无效。
如果可能,这个事实倾向于使用HTTP头,因为HTTP头中的顺序并不重要。



如果浏览器仍然使用兼容模式标头或元标记之一可能是原因:




  • 您缺少正确的doctype

  • 浏览器已设置为始终使用兼容性模式

  • 网站托管在Intranet网站上,并且已设置Intranet网站的默认设置



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

Microsoft至少考虑了192.168 .xx在Intranet网站上。 IE8 / IE9中Intranet站点的默认值是使用兼容模式。这对于许多业务应用程序是一个巨大的问题,因为程序员不能覆盖这个选项,甚至使用这个元标记。 (在兼容性视图中显示Intranet网站不能通过元标记或http标头覆盖 - 浏览器在此情况下完全控制兼容性视图)





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



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


I have this in the <head>:

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

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

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.

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:

  • you are missing a sane doctype
  • the browser has been set to always use compatibility mode
  • the site is hosted on an "intranet site" and the default setting for intranet sites is set

Changing the browsers Compatibility View settings

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)

Always add this meta tag or an http header?

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天全站免登陆