简体   繁体   English

即使IE = EmulateIE7,IE8兼容性视图按钮也会启用

[英]IE8 Compatibility View Button is enabled even when IE=EmulateIE7

For our web application, we are sending the X-UA-Compatible -> IE=EmulateIE7 for all the pages. 对于我们的Web应用程序,我们将为所有页面发送X-UA-Compatible - > IE = EmulateIE7。 However, the Compatibility View Button next to the Refresh button, is still displayed. 但是,仍会显示“刷新”按钮旁边的“兼容性视图”按钮。

1) Is this expected behaviour? 1)这是预期的行为吗? 2) Shouldn't the HTTP header force the browser to display in IE7 mode (with Quirks + IE7Standards enabled), and then now show the Compatibility View button? 2)HTTP标头不应强制浏览器以IE7模式显示(启用Quirks + IE7Standards),然后现在显示兼容性视图按钮?

If a site is not IE8 ready, is there a way to force IE7 emulation, and thus disable this button? 如果某个站点没有准备好IE8,是否有办法强制IE7仿真,从而禁用此按钮?

According to Just The Facts: Recap of Compatibility View you've declared [your website] "ready" for Internet Explorer 8 through the use of the versioning tag . 根据Just The Facts:Recap of Compatibility View,您已通过使用版本控制标记为Internet Explorer 8宣布[您的网站]已“准备就绪” The Compatibility View button should not be displayed: 不应显示兼容性视图按钮:

Site owners are always in control of their content. 网站所有者始终控制其内容。 By default, Internet Explorer uses DOCTYPE switching to determine Quirks v. Standards mode (again, Standards mode maps to IE8 Standards by default). 默认情况下,Internet Explorer使用DOCTYPE切换来确定Quirks v。标准模式(同样,标准模式默认情况下映射到IE8标准)。 Site owners can choose to use the X-UA-Compatible tag to be absolutely declarative about how they'd like their site to display and to map Standards mode pages to IE7 Standards. 网站所有者可以选择使用X-UA-Compatible标签来绝对声明他们希望他们的网站如何显示以及将标准模式页面映射到IE7标准。 Use of the X-UA-Compatible tag overrides Compatibility View on the client. 使用X-UA-Compatible标记会覆盖客户端上的兼容性视图。

Sometimes the Compatibility View button isn't displayed. 有时不显示兼容性视图按钮。 The button is located on the address bar next to the 'stop' and 'refresh' buttons. 该按钮位于“停止”和“刷新”按钮旁边的地址栏上。 There are a few cases where there's no action for a user take and, thus, the Compatibility View button will not show: 在某些情况下,用户无需采取任何操作,因此,“兼容性视图”按钮不会显示:

  • If you're viewing an internal-to-Internet Explorer page (such as about:InPrivate) 如果您正在查看内部到Internet Explorer页面(例如about:InPrivate)
  • If you're viewing a page that has declared it's "ready" for Internet Explorer 8 through use of the versioning tag / HTTP header (it doesn't matter if this tag triggers Quirks, IE7 Standards, or IE8 Standards, the button won't be displayed) 如果您正在查看通过使用版本控制标记/ HTTP标头声明已为Internet Explorer 8“准备好”的页面(如果此标记触发Quirks,IE7标准或IE8标准无关紧要,则按钮赢了'显示)
  • If you're viewing an intranet page and you have the 'Display intranet sites in Compatibility View' checkbox selected 如果您正在查看Intranet页面,并且选中了“在兼容性视图中显示Intranet站点”复选框
  • If you're viewing any webpage and you have the 'Display all websites in Compatibility View' checkbox selected 如果您正在查看任何网页,并且选中了“在兼容性视图中显示所有网站”复选框
  • If you're viewing a webpage that is included on the Microsoft-supplied compatibility view updates list and you have the 'Include updated website lists from Microsoft' checkbox selected 如果您正在查看Microsoft提供的兼容性视图更新列表中包含的网页,并且您选中了“包括Microsoft的更新网站列表”复选框
  • If you've toggled either the 'Document Mode' or 'Browser Mode' settings via the Developer Toolbar 如果您通过开发人员工具栏切换了“文档模式”或“浏览器模式”设置

If you're using an HTTP header, have you used Fiddler to verify that the X-UA-Compatible header is actually being delivered on every page? 如果您正在使用HTTP标头,您是否使用过Fiddler来验证每个页面上是否实际交付了X-UA-Compatible标头?

If you're using a META tag, then according to META Tags and Locking in Future Compatibility : 如果您使用的是META标签,那么根据META标签和未来兼容性锁定

The X-UA-compatible header is not case sensitive; 兼容X-UA的标头不区分大小写; however, it must appear in the Web page's header (the HEAD section) before all other elements, except for the TITLE element and other META elements. 但是,除了TITLE元素和其他META元素之外,它必须出现在所有其他元素之前的Web页面标题(HEAD部分)中。

Lastly, is IE8 actually in Compatibility View when the button shows up? 最后,当按钮显示时,IE8实际上是兼容性视图中吗? If so, it is possible that your website is in IE8's compatibility list from Microsoft, or in the local client configuration: 如果是这样,您的网站可能是Microsoft的IE8兼容性列表,或者是本地客户端配置:

  • Tools > Compatibility View Settings Tools > Compatibility View Settings
  • Ensure your site isn't listed under Websites you've added to Compatibility View 确保您的网站未列在已添加到兼容性视图的网站
  • Try unchecking Include updated website lists from Microsoft and restarting the browser 尝试取消选中包含Microsoft的更新网站列表并重新启动浏览器

I had an issue on our workwear site whereby, we initally had to use the Meta EmulateIE7 to overcome CSS issues when IE8 was first released. 我在我们的工作服网站上遇到了一个问题,我们最初不得不使用Meta EmulateIE7来克服IE8首次发布时的CSS问题。 We later rectified the problem and added the meta tag X-UA-Compatible IE=8 我们后来纠正了这个问题并添加了元标记X-UA-Compatible IE = 8

What we noticed is, even when clearing the browsers cache IE8 still retained the state of the compatibility button set by the user. 我们注意到的是,即使清除浏览器缓存,IE8仍然保留了用户设置的兼容性按钮的状态。 It was important for us to overcome this because it was causing scripting issues when running in compatibility mode. 我们必须克服这一点,因为它在兼容模式下运行时会导致脚本问题。

We solved the problem by having X-UA-Compatible IE=8 in the head of all pages and also adding it to IIS as a HTTP Header. 我们通过在所有页面的头部使用X-UA-Compatible IE = 8并将其作为HTTP标头添加到IIS来解决了这个问题。 The compatibility button no longer shows on visitors browsers =) 兼容性按钮不再显示在访问者浏览器上=)

Hope this helps! 希望这可以帮助!

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

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