Internet Explorer 兼容性的管理提示和技巧Tips and tricks to manage Internet Explorer compatibility

重要

从 2021 年 8 月 17 日开始,Microsoft 365 应用和服务将不支持 Internet Explorer 11(从 2020 年 11 月 30 日开始,Microsoft Teams 将不再支持 Internet Explorer 11)。Microsoft 365 apps and services will not support Internet Explorer 11 starting August 17, 2021 (Microsoft Teams will not support Internet Explorer 11 earlier, starting November 30, 2020). 了解详细信息Learn more. 请注意,Internet Explorer 11 仍将是受支持的浏览器。Please note that Internet Explorer 11 will remain a supported browser. Internet Explorer 11 是 Windows 操作系统的一个组件,遵循安装它的产品的生命周期策略Internet Explorer 11 is a component of the Windows operating system and follows the Lifecycle Policy for the product on which it is installed.

了解如何通过企业模式站点列表为旧版 web 应用程序实现更好的向后兼容性。Find out how to achieve better backward compatibility for your legacy web applications with the Enterprise Mode Site List.

跳转到:Jump to:

Internet Explorer 11 的企业模式 在为较旧的 web 应用提供向后兼容性方面可能非常有效。Enterprise Mode for Internet Explorer 11 can be very effective in providing backward compatibility for older web apps. 企业模式网站列表包括在任何文档模式下放置任意 web 应用的功能,包括 IE8 和 IE7 企业模式,而无需更改网站上的单行代码。The Enterprise Mode Site List includes the ability to put any web app in any document mode, include IE8 and IE7 Enterprise Modes, without changing a single line of code on the website.

Internet Explorer 企业模式和文档模式

分区中的网站 <docMode> 可以在任何文档模式下呈现,如上面的蓝色所示。Sites in the <docMode> section can be rendered in any document mode, as shown in blue above. 某些针对较旧版本的 Internet Explorer 设计的网站可能需要更好的向后兼容性,并且这些网站可以利用 <emie> 企业模式网站列表中的部分。Some sites designed for older versions of Internet Explorer may require better backward compatibility, and these can leverage the <emie> section of the Enterprise Mode Site List. IE8 企业模式通过使用原始 Internet Explorer 8 用户代理字符串等其他改进功能,为 Internet Explorer 8 提供更高保真的模拟。IE8 Enterprise Mode provides higher-fidelity emulation for Internet Explorer 8 by using, among other improvements, the original Internet Explorer 8 user agent string. IE7 企业模式通过添加 "兼容性" 视图进一步改善模拟。IE7 Enterprise Mode further improves emulation by adding Compatibility View.

兼容性视图(首次使用 Internet Explorer 8 引入)基本上是一个开关。Compatibility View, first introduced with Internet Explorer 8, is basically a switch. 如果某个网页没有 DOCTYPE,则该页面将在 Internet Explorer 5 模式下呈现。If a webpage has no DOCTYPE, that page will be rendered in Internet Explorer 5 mode. 如果存在 DOCTYPE,则页面将在 Internet Explorer 7 模式下呈现。If there is a DOCTYPE, the page will be rendered in Internet Explorer 7 mode. 你可以通过在分区中指定 Internet Explorer 7 来有效地获取兼容性视图 <docMode> ,因为如果不存在 DOCTYPE,则会自动返回到 Internet explorer 5,或者你可以使用 IE7 企业模式更好地进行模拟。You can effectively get Compatibility View by specifying Internet Explorer 7 in the <docMode> section, as this falls back to Internet Explorer 5 automatically if there's no DOCTYPE, or you can use IE7 Enterprise Mode for even better emulation.

面向 IT 专业人员的提示Tips for IT professionals

清点您的网站Inventory your sites

升级到新的浏览器可能会非常耗时且潜在昂贵的风险。Upgrading to a new browser can be a time-consuming and potentially costly venture. 为了帮助降低这些成本,您可以下载 企业网站发现工具包,该工具包可帮助你根据你的企业中的使用情况来确定应测试哪些网站的优先级。To help reduce these costs, you can download the Enterprise Site Discovery Toolkit, which can help you prioritize which sites you should be testing based on their usage in your enterprise. 例如,如果数据显示没有人访问特定的旧 web 应用,则您可能不需要对其进行测试或修复。For example, if the data shows that no one is visiting a particular legacy web app, you may not need to test or fix it. Internet Explorer 8、Internet Explorer 9、Internet Explorer 10 和 Internet Explorer 11 支持该工具包。The toolkit is supported on Internet Explorer 8, Internet Explorer 9, Internet Explorer 10, and Internet Explorer 11. 该工具包还向你提供有关页面在当前浏览器中运行的文档模式的信息,以便你可以更好地了解当该网站在较新版本的浏览器中中断时如何修复该网站。The toolkit also gives you information about which document mode a page runs in your current browser so you can better understand how to fix that site if it breaks in a newer version of the browser.

一旦您知道要测试和修复的网站,以下补救方法可帮助修复 Internet Explorer 11 和 Windows 10 中的兼容性问题。Once you know which sites to test and fix, the following remediation methods may help fix your compatibility issues in Internet Explorer 11 and Windows 10.

如果你在 Internet Explorer 8 上并升级到 Internet Explorer 11:If you're on Internet Explorer 8 and upgrading to Internet Explorer 11:

使用企业模式网站列表将网站添加到 Internet Explorer 5、Internet Explorer 7 和 Internet Explorer 8 文档模式,以及 IE8 企业模式和 IE7 企业模式。Use the Enterprise Mode Site List to add sites to the Internet Explorer 5, Internet Explorer 7, and Internet Explorer 8 documents modes, as well as IE8 Enterprise Mode and IE7 Enterprise Mode.

  • x-ua 兼容 的 meta 标记或 HTTP 头设置为 "IE = edge" 的网站可能会在 Internet explorer 11 中中断,并且需要设置为 internet explorer 8 模式。Sites with the x-ua-compatible meta tag or HTTP header set to "IE=edge" may break in Internet Explorer 11 and need to be set to Internet Explorer 8 mode. 这是因为 Internet Explorer 8 中的 "edge" 指的是 Internet Explorer 8 模式,而 Internet Explorer 11 中的 "edge" 则意味着 Internet Explorer 11 模式。This is because "edge" in Internet Explorer 8 meant Internet Explorer 8 mode, but "edge" in Internet Explorer 11 means Internet Explorer 11 mode.

  • 在 Intranet 以外的区域中没有 DOCTYPE 的网站将默认为 QME (或 "可互操作的可使用性" ) ,而不是 Internet Explorer 5 的其他特点,可能需要设置为 Internet Explorer 5 模式。Sites without a DOCTYPE in zones other than Intranet will default to QME (or "interoperable quirks") rather than Internet Explorer 5 Quirks and may need to be set to Internet Explorer 5 mode.

  • 某些网站可能需要添加到企业模式和兼容性视图中才能正常工作。Some sites may need to be added to both Enterprise Mode and Compatibility View to work. 你可以通过将网站添加到 IE7 企业模式来执行此操作。You can do this by adding the site to IE7 Enterprise Mode.

如果你在 Internet Explorer 9 上并升级到 Internet Explorer 11:If you're on Internet Explorer 9 and upgrading to Internet Explorer 11:

使用企业模式网站列表将网站添加到 Internet Explorer 5、Internet Explorer 7 和 Internet Explorer 9 文档模式。Use the Enterprise Mode Site List to add sites to the Internet Explorer 5, Internet Explorer 7, and Internet Explorer 9 document modes.

  • x-ua 兼容 的 meta 标记或 HTTP 头设置为 "IE = edge" 的网站可能会在 Internet explorer 11 中中断,并且需要设置为 internet explorer 9 模式。Sites with the x-ua-compatible meta tag or HTTP header set to "IE=edge" may break in Internet Explorer 11 and need to be set to Internet Explorer 9 mode. 这是因为 Internet Explorer 9 中的 "edge" 意味着 Internet Explorer 9 模式,但 Internet Explorer 11 中的 "edge" 意味着 Internet Explorer 11 模式。This is because "edge" in Internet Explorer 9 meant Internet Explorer 9 mode, but "edge" in Internet Explorer 11 means Internet Explorer 11 mode.

  • 在 Intranet 之外的区域中没有 DOCTYPE 的网站将默认为可互操作的特点,而不是 Internet Explorer 5 的兼容性,可能需要设置为 Internet Explorer 5 模式。Sites without a DOCTYPE in zones other than Intranet will default to Interoperable Quirks rather than Internet Explorer 5 Quirks and may need to be set to Internet Explorer 5 mode.

  • 如果您的网站在 Internet Explorer 9 中工作,则不需要 IE8 企业模式或 IE7 企业模式。If your sites worked in Internet Explorer 9, you won't need IE8 Enterprise Mode or IE7 Enterprise Mode.

如果你在 Internet Explorer 10 上,并且升级到 Internet Explorer 11:If you're on Internet Explorer 10 and upgrading to Internet Explorer 11:

使用企业模式网站列表将网站添加到 Internet Explorer 5、Internet Explorer 7 和 Internet Explorer 10 模式。Use the Enterprise Mode Site List to add sites to the Internet Explorer 5, Internet Explorer 7, and Internet Explorer 10 modes.

  • x-ua 兼容 的 meta 标记或 HTTP 头设置为 "IE = edge" 的网站可能会在 internet explorer 11 中中断,并且需要设置为 internet explorer 10 模式。Sites with the x-ua-compatible meta tag or HTTP header set to "IE=edge" may break in Internet Explorer 11 and need to be set to Internet Explorer 10 mode. 这是因为 Internet Explorer 10 中的 "edge" 意味着 Internet Explorer 10 模式,但 Internet Explorer 11 中的 "edge" 意味着 Internet Explorer 11 模式。This is because "edge" in Internet Explorer 10 meant Internet Explorer 10 mode, but "edge" in Internet Explorer 11 means Internet Explorer 11 mode.

  • 如果您的网站在 Internet Explorer 10 中工作正常,则不需要 IE8 企业模式或 IE7 企业模式。If your sites worked in Internet Explorer 10, you won't need IE8 Enterprise Mode or IE7 Enterprise Mode.

如果你在 Internet Explorer 11 上,并且升级到 Windows 10:If you're on Internet Explorer 11 and upgrading to Windows 10:

一切就绪!You're all set! 您不需要进行任何更改。You shouldn’t need to make any changes.

适用于 web 开发人员的提示Tips for web developers

如果您的网站在较早版本的 Internet Explorer 中运行,但在 Internet Explorer 11 中不再有效,您可能需要更新网站。If your website worked in an older version of Internet Explorer, but no longer works in Internet Explorer 11, you may need to update the site. 下面是您需要找到相应的补救策略的一组步骤。Here are the set of steps you should take to find the appropriate remediation strategy.

尝试文档模式Try document modes

若要查看网站在 Internet Explorer 5、Internet Explorer 7、Internet Explorer 8、Internet Explorer 9、Internet Explorer 10 或 Internet Explorer 11 文档模式中是否正常工作,请执行以下操作:To see if the site works in the Internet Explorer 5, Internet Explorer 7, Internet Explorer 8, Internet Explorer 9, Internet Explorer 10, or Internet Explorer 11 document modes:

  • 在 Internet Explorer 11 中打开网站,通过按f12键或从 "工具" 菜单中选择 " f12 开发工具" 来加载 F12 工具,然后选择 "模拟" 选项卡。Open the site in Internet Explorer 11, load the F12 tools by pressing the F12 key or by selecting F12 Developer Tools from the Tools menu, and select the Emulation tab.

    F12 开发工具模拟选项卡

  • 在每个文档模式下运行网站,直到找到网站的工作模式。Run the site in each document mode until you find the mode in which the site works.

    备注

    你将需要确保 "用户代理字符串" 下拉列表与 "文档模式" 下拉列表中的浏览器版本匹配。You will need to make sure the User agent string dropdown matches the same browser version as the Document mode dropdown. 例如,如果你要测试网站在 Internet Explorer 10 中是否正常工作,你应该将文档模式下拉列表更新为10,将用户代理字符串下拉菜单更新到 Internet Explorer 10。For example, if you were testing to see if the site works in Internet Explorer 10, you should update the Document mode dropdown to 10 and the User agent string dropdown to Internet Explorer 10.

  • 如果找到您的网站工作的模式,则需要将网站域、子域或 URL 添加到企业模式网站列表,以了解网站工作的文档模式,或要求 IT 管理员执行此操作。If you find a mode in which your site works, you will need to add the site domain, sub-domain, or URL to the Enterprise Mode Site List for the document mode in which the site works, or ask the IT administrator to do so. 也可以添加 x-ua 兼容的 meta 标记或 HTTP 标头。You can add the x-ua-compatible meta tag or HTTP header as well.

试用 IE8 企业模式Try IE8 Enterprise Mode

如果文档模式未修复您的网站,请尝试 IE8 企业模式,这将为 Internet Explorer 5、Internet Explorer 7 和 Internet Explorer 8 文档模式编写的好处网站提供好处。If a document mode didn't fix your site, try IE8 Enterprise Mode, which benefits sites written for Internet Explorer 5, Internet Explorer 7, and Internet Explorer 8 document modes.

  • 允许用户从本地计算机上 的 "工具" 菜单策略中打开和使用企业模式Enable the Let users turn on and use Enterprise Mode from the Tools menu policy locally on your machine. 若要实现此目的,请执行以下操作:To do this:

    • 搜索并运行 gpedit.mscSearch for and run gpedit.msc

    • 导航到 "计算机配置" > 管理模板 > Windows 组件" > Internet Explorer"。Navigate to Computer Configuration > Administrative Template > Windows Components > Internet Explorer.

    • "工具" 菜单组策略设置中启用 "允许用户打开" 和 "使用企业模式 "。Enable the Let users turn on and use Enterprise Mode from the Tools menu Group Policy setting.

    进行此更改后,请运行 gpupdate.exe/force 以确保该设置在本地应用。After making this change, run gpupdate.exe /force to make sure the setting is applied locally. 完成测试后,您还应确保禁用此设置。You should also make sure to disable this setting once you're done testing. 或者,您也可以使用 regkey;有关详细信息,请参阅 打开本地控制和企业模式日志记录Alternately, you can use a regkey; see Turn on local control and logging for Enterprise Mode for more information.

  • 重新启动 Internet Explorer 11 并打开正在测试的网站,然后转到 " F12 开发工具" 工具中的 "仿真" 选项卡,然后从浏览器配置文件下拉列表中选择 "企业"。Restart Internet Explorer 11 and open the site you're testing, then go to Emulation tab in the F12 Developer Tools and select Enterprise from the Browser profile dropdown. 如果网站正常工作,请通知 IT 管理员需要将该网站添加到 IE8 企业模式部分。If the site works, inform the IT administrator that the site needs to be added to the IE8 Enterprise Mode section.

尝试 IE7 企业模式Try IE7 Enterprise Mode

如果 IE8 企业模式不起作用,则 IE7 企业模式将为您提供与企业模式一起使用 Internet Explorer 8 附带的兼容性视图行为。If IE8 Enterprise Mode doesn't work, IE7 Enterprise Mode will give you the Compatibility View behavior that shipped with Internet Explorer 8 with Enterprise Mode. 若要尝试此方法,请执行以下操作:To try this approach:

  • 转到 " 工具 " 菜单,选择 " 兼容性视图设置",然后将网站添加到列表。Go to the Tools menu, select Compatibility View Settings, and add the site to the list.

  • 转到F12 开发人员工具中的 "模拟" 选项卡,然后从浏览器配置文件下拉列表中选择企业Go to Emulation tab in the F12 Developer Tools and select Enterprise from the Browser profile dropdown.

如果网站正常工作,请通知 IT 管理员需要将该网站添加到 IE7 企业模式部分。If the site works, inform the IT administrator that the site needs to be added to the IE7 Enterprise Mode section.</span>

备注

将相同的 Web 路径添加到企业模式和企业模式网站列表部分将不起作用,但我们将在将来的更新中解决此情况。Adding the same Web path to the Enterprise Mode and sections of the Enterprise Mode Site List will not work, but we will address this in a future update.

更新新式 web 标准的网站Update the site for modern web standards

我们建议,企业客户将重点放在已建立的新式 web 标准上,以获得更好的性能和跨设备互操作性,避免在旧的 Internet Explorer 文档模式下开发网站。We recommend that enterprise customers focus their new development on established, modern web standards for better performance and interoperability across devices, and avoid developing sites in older Internet Explorer document modes. 我们经常听到,由于 Intranet 区域默认为兼容性视图,web 开发人员在 Intranet 区域中无意间在 Internet Explorer 7 或 Internet Explorer 5 模式中创建新网站,具体取决于他们是否使用 DOCTYPE。We often hear that, due to fact that the Intranet zone defaults to Compatibility View, web developers inadvertently create new sites in the Internet Explorer 7 or Internet Explorer 5 modes in the Intranet zone, depending on whether or not they used a DOCTYPE. 当你将 web 应用移动到新式标准时,你可以为本地 intranet 组策略设置启用 " 打开 Internet Explorer 标准" 模式 ,并将需要 Internet explorer 5 或 internet explorer 7 模式的网站添加到网站列表。As you move your web apps to modern standards, you can enable the Turn on Internet Explorer Standards Mode for local intranet Group Policy setting and add those sites that need Internet Explorer 5 or Internet Explorer 7 modes to the Site List. 当然,测试应用以确保这些设置适用于你的环境始终是一个好主意。Of course, it is always a good idea to test the app to ensure that these settings work for your environment.

相关资源Related resources