IE8 to include version targeting
I so called it. Back in December, I gave my predictions and on the list was version targeting using the
meta element. I even said it'd be using
Aaron Gustafson has an article on A List Apart entitled Beyond DOCTYPE that talks about a Internet Explorer's new approach to targeting rendering engines. Like a charset declaration, the
X-UA-Compatible declaration can be declared using a meta tag or via HTTP headers, meaning that flipping the switch for all pages on a server to support new browsers will be a 5 minute process.
Here's what the meta tag would look like:
<meta http-equiv="X-UA-Compatible" content="IE=8" /> <meta http-equiv="X-UA-Compatible" content="IE=8;FF=3;OtherUA=4" />
Although Internet Explorer is first out of the gate to support this, it was designed to be agnostic, allowing other browser developers to use this same approach of version targeting.
Why do we need targeting?
The biggest reason is support for legacy web sites. If you think version targeting like this is something new, it's not. We already have a basic opt-in approach to version targeting: the DOCTYPE switch. The new
X-UA-Compatible declaration just takes it to another level.
The fact is, as each new browser comes out and fixes bugs from older versions, our sites need to be revisited. Until we have a chance to do so, our sites shouldn't break. Remember, this isn't about us, the developers, but about the end users who have to visit and use these sites day-to-day. Upgrading their browser shouldn't break the web.
I don't want to target
If you decide to do nothing then the sites you design for Internet Explorer will continue to pretend it's IE7. Or, if you didn't use a doctype, it'll pretend it's IE5.5 (I'm guessing here since this is the last version before the doctype switch).
Alternatively, if you want to make sure your pages always use the most recent rendering engine, regardless, then you can specify that it always uses the latest version.
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
What still isn't clear for me is how to specify the latest of every browser. Does
OtherUA=edge work for all browsers if not specifically mentioned? I'm sure this stuff will get sorted out before long.
I, for one, welcome our new