问题
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?
回答1:
"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.
回答2:
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
.
回答3:
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.
来源:https://stackoverflow.com/questions/8742663/use-edge-or-ie9-for-x-ua-compatible-header