使用“边缘”或“IE9”对于 X-UA 兼容标头?
在我的 .htaccess 文件中,我有这个标头:
标头设置 X-UA-Compatible“IE=Edge,chrome=1”
我针对 IE7-9(和其他浏览器)优化了我的网站,但现在 IE10 即将推出,我是否应该仍然使用“Edge”值或“ IE9 的价值能保证我的网站能在 IE10 中运行吗?换句话说,IE10 是否会发生这样的变化,以至于它可能会破坏我在 IE9 中运行良好的网站?
In my .htaccess file I have this header:
Header set X-UA-Compatible "IE=Edge,chrome=1"
I optimise my sites for IE7-9 (and other browsers), but now that IE10 is coming up, should I still be using the 'Edge' value or 'IE9' value to guarantee my sites will work in IE10? In other words, could IE10 have such changes that it could break my site which worked fine in IE9?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
“保证”是一个很强烈的词。 Windows 8/IE10 的测试版尚未发布,因此一切都可能会发生变化。目前,“保证”您的站点适用于未来未发布版本的 IE 的唯一方法是将兼容模式设置为 IE9。
然而,话虽这么说,IE10 似乎是带有 HTML5 和 HTML5 的 IE9。 CSS3 支持。它基于 IE9 构建并添加了新的附加功能。您的网站(以及大多数(如果不是几乎所有)网站)很可能在 IE10 中呈现而不会出现任何问题。
您绝对应该查看 Internet Explorer 10 开发人员指南:CSS 和此 IE10 新功能概述。
最好的办法是下载 Windows 开发者预览版(即: Windows 8 预览版)并自行测试。这可能看起来是一项艰巨的工作,但您可以花一些时间设置一个使用 Windows 8 的虚拟机,然后就可以完成所有需要执行的测试。
"Guarantee" is a strong word. A beta of Windows 8/IE10 has not yet been released so everything is subject to change. Right now, the only way to "guarantee" your site for a future unreleased version of IE is to set the compatibility mode to IE9.
However, that being said, IE10 appears to be IE9 with HTML5 & CSS3 support. It builds on IE9 and adds new additional functionality. It is very likely that your site (and most, if not almost all sites) will be rendered in IE10 without any problems.
You should definitely check out the Internet Explorer 10 Developer Guide: CSS and this overview of new features in IE10.
The best thing to do is download the Windows Developer Preview (ie: the preview version of Windows 8) and test for yourself. That might seem like a big job but you can spend a bit of time setting up a virtual machine with Windows 8 and then you'll be all set for all of the testing you need to do.
我会推荐
IE=Edge
,只需尝试 IE10 beta 并提前修复任何损坏的内容即可。考虑一下您是否对 IE7 提出了同样的问题,并且决定离开
IE=IE7
。快进几年,您故意阻止新版本的 IE 使用您过时的代码。最好始终使用最新的浏览器。仅供参考,IE9 是一个非常强大的浏览器,您的代码仍然在 IE9 上强制使用 Chrome Frame。您可能只想为 IE8 及更早版本启用 Chrome 内嵌框架,可以通过将 chrome 参数更改为
chrome=IE8
来实现。I would recommend
IE=Edge
, and simply try the IE10 beta and fix anything that's broken ahead of time.Consider if you had the same question posed for IE7, and you decided to leave
IE=IE7
. Fast forward a few years and you're deliberately hobbling new versions of IE to use your outdated code. It's always best to stay up to date with the latest browsers.FYI IE9 is a pretty capable browser and your code still forces Chrome Frame on IE9. You might only want to enable Chrome Frame for IE8 and earlier, which you can do by changing the chrome parameter to
chrome=IE8
.如果您观察到良好的编码技术。 IE10 看起来像完全可互操作的浏览器,因此如果您提供特定于 IE 的代码,您可能应该停止这样做,并以与 Firefox 或 Chrome 相同的方式对待 IE10。
如果您使用
或其他触发标准模式的文档类型,则通常不需要
IE=edge
标头。Your website should work just fine if you observe good coding techniques. IE10 looks like fully interoperable browser, so if you deliver IE-specific code, you should probably stop doing that and treat IE10 the same way as Firefox or Chrome.
IE=edge
header usually isn't required if you use<!doctype html>
or another doctype that triggers standards mode.