简体   繁体   English

IE9和IE9兼容性视图浏览器模式之间的区别

[英]Difference between IE9 and IE9 Compatibility View browser mode

What is the difference between IE9 and IE9 Compatibility View browser mode? IE9和IE9兼容性视图浏览器模式有什么区别? Also if I am adding X-UA-Compatible header at server-side (Java), does it impact the Browser mode ? 另外,如果我在服务器端(Java)添加X-UA-Compatible标头,是否会影响浏览器模式?

httpRes.addHeader("X-UA-Compatible", "IE=edge");

Does this override the Browser Mode? 这会覆盖浏览器模式吗?

I need a way by which even if the user plays around with the Developer toolbar Mode settings, he is never shown the compatibility view. 我需要一种方法,即使用户使用开发人员工具栏的“模式”设置,也永远不会看到他的兼容性视图。 How can I do that? 我怎样才能做到这一点?

我不知道您是否已经在这里阅读,这里有明确的解释!

You cannot stop the user from playing around with the developer toolbar, and to be honest that is a very very good thing. 您不能阻止用户使用开发人员工具栏,老实说这是一件非常非常好的事情。 I wouldn't want you to take control over my browser, not that I'm using IE, but still. 我不想让您控制我的浏览器,不是说我使用的是IE,而是。

What you can do however is to tell the browser how it should render your page. 但是,您可以做的是告诉浏览器它应如何呈现页面。 And that's what the X-UA-Compatible is for. 这就是X-UA兼容的目的。

Okay so actually answer some of your questions: 好的,所以实际上回答您的一些问题:

Compability view is for sites that are designed for older versions of IE. 兼容性视图适用于针对IE较早版本设计的网站。

Websites that are designed for older versions of Windows Internet Explorer don't always display as expected in the current version. 专为Windows Internet Explorer较旧版本设计的网站并不总是在当前版本中按预期显示。 We addressed this in Windows Internet Explorer 8 by adding the Compatibility View function that allows users to "revert" to a previous browser version of the platform, which emulates IE7 Standards mode. 我们在Windows Internet Explorer 8中通过添加兼容性视图功能解决了此问题,该功能允许用户“还原”到该平台的先前浏览器版本,该版本模仿IE7标准模式。

Which you can read in the link provided by @Alesanco. 您可以在@Alesanco提供的链接中阅读。

So what does X-UA-Compatible do? 那么X-UA-Compatible什么作用? Well it tells the browser in which mode it should render the page, which means that you can tell IE9 to render the page as if it was IE5. 好吧,它告诉浏览器应该以哪种模式呈现页面,这意味着您可以告诉IE9呈现页面,就好像它是IE5。 This means that you can control the rendering of the page to some extent, but you cannot expect to have control over wether the user plays around with the developer toolbar or not, unless you have access to the users computer. 这意味着您可以在某种程度上控制页面的呈现,但是除非您可以访问用户计算机,否则您不能期望控制用户是否使用开发人员工具栏。

See this thread for more information. 有关更多信息,请参见此线程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM