What is the point of X-UA-Compatible?

Farley McJizzle picture Farley McJizzle · Sep 4, 2011 · Viewed 8.1k times · Source

I don't understand at all what <meta http-equiv="X-UA-Compatible" content="..." /> is for...

Can someone explain...

  • What it does for different values of content?
  • What omitting it does for different browsers?
  • What the motivation for it is?
  • Why it exists?

Answer

Okonomiyaki3000 picture Okonomiyaki3000 · May 1, 2012

This meta tag (or http header) only has meaning for IE8 and up. It is a way to force IE to render the page as an older version would have. Omitting it has no effect, it only as effect if used.

Possible values are "IE=" followed by any of the following:

  • Edge - Render as whatever the latest version of IE is
  • IE9 - Render as IE9 in standards mode
  • Emulate IE9 - Render as IE9 but use the <!DOCTYPE> to determine the mode
  • IE8 - Render as IE8 in standards mode
  • Emulate IE8 - Render as IE8 but use the <!DOCTYPE> to determine the mode
  • IE7 - Render as IE7 in standards mode
  • Emulate IE7 - Render as IE7 but use the <!DOCTYPE> to determine the mode
  • IE5 - Render as IE7 in quirks mode

Additionally, you can add a comma followed by Chrome=1 to tell IE to render the page using Google Chrome Frame if it is installed. So you might have a tag that looks like this:

<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">

Or, instead of that, you can also specify to use GCF for for a specific version of IE and below like this:

<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=IE8">

Which means to use GCF if it is installed and IE is at version 8 or below otherwise, render as the latest installed version of IE.

So, it's obvious that it is useful to be able to make older versions of IE use GCF but that was probably not Microsoft's intention when they implemented this. It can be used for compatibility with old sites that only work in older versions of IE and can't be easily fixed but that's kind of silly. Personally, I find it useful for testing. Since it's generally not so simple to test multiple versions of IE from a single development machine, this provides a decent solution.