http://frankcode.wordpress.com/2013/10/17/a-guide-to-ie-compatibility-view-and-x-ua-compatible/
http://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx Defining Document Compatibility
http://msdn.microsoft.com/en-us/library/gg699338%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/gg699340%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/gg589507%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/jj676915%28v=vs.85%29.aspx
http://stackoverflow.com/questions/6771258/whats-the-difference-if-meta-http-equiv-x-ua-compatible-content-ie-edge-e
http://msdn.microsoft.com/en-us/library/cc288325%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/ie/ms533876%28v=vs.85%29.aspx
http://www.validatethis.co.uk/news/fix-bad-value-x-ua-compatible-once-and-for-all/
http://www.modern.ie/en-us/performance/how-to-use-x-ua-compatible
http://www.456bereastreet.com/archive/201103/x-ua-compatible_and_html5/
http://farukat.es/journal/2009/05/245-ie8-and-the-x-ua-compatible-situation
How to determine document compatibility mode?
engine = null;
if (window.navigator.appName == "Microsoft Internet Explorer")
{
// This is an IE browser. What mode is the engine in?
if (document.documentMode) // IE8
engine = document.documentMode;
else // IE 5-7
{
engine = 5; // Assume quirks mode unless proven otherwise
if (document.compatMode)
{
if (document.compatMode == "CSS1Compat")
engine = 7; // standards mode
}
}
// the engine variable now contains the document compatibility mode.
}
The documentMode property returns a numeric value corresponding to the page's document compatibility mode. For example, if a page has chosen to support IE8 mode, documentMode returns the value 8.
How to specify document compatibility mode?
<meta http-equiv="X-UA-Compatible" content="IE=4"> <!-- IE5 mode -->
<meta http-equiv="X-UA-Compatible" content="IE=7.5" > <!-- IE7 mode -->
<meta http-equiv="X-UA-Compatible" content="IE=100" > <!-- IE8 mode -->
<meta http-equiv="X-UA-Compatible" content="IE=a" > <!-- IE5 mode -->
<meta http-equiv="X-UA-Compatible" content="IE=edge" > <!-- Use the latest experimental features -->
<!-- This header mimics Internet Explorer 7 and uses
<!DOCTYPE> to determine how to display the Web page -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
The previous example shows the results of individual content values. In practice, Internet Explorer only respects the first X-UA-Compatible header in a Web page.
You can also use the content attribute to specify multiple document compatibility modes; this helps ensure that your Web pages are displayed consistently in future versions of the browser. To specify multiple document modes, set the content attribute to identify the modes you want to use. Use a semicolon to separate each mode.
If a particular version of Internet Explorer supports more than one requested compatibility mode, it will use the highest available mode listed in the header's content attribute. You can use this fact to exclude specific compatibility modes, although this is not recommended. For example, the following header excludes IE7 mode:
<meta http-equiv="X-UA-Compatible" content="IE=5; IE=8" >
How to control the default rendering mode?
When Internet Explorer 8 encounters a Web page that does not contain an X-UA-Compatible header, it uses the <!DOCTYPE> directive to determine how to display the page. If the directive is missing or does not specify a standards-based document type, Internet Explorer 8 displays the page in IE5 mode (quirks mode).
If the <!DOCTYPE> directive specifies a standards-based document type, Internet Explorer 8 displays the page in IE8 mode, except in the following cases:
- Compatibility View is enabled for the page.
- The page is loaded in the Intranet zone and Internet Explorer 8 is configured to display pages in the Intranet zone in Compatibility View.
- Internet Explorer 8 is configured to display all Web sites in Compatibility View.
- Internet Explorer 8 is configured to use the Compatibility View List, which specifies a set of Web sites that are always displayed in Compatibility View.
- The Developer Tools are used to override the settings specified in the Web page.
- The Web page encountered a page layout error and Internet Explorer 8 is configured to automatically recover from such errors by reopening the page in Compatibility View.
When configured to load Intranet pages in Compatibility View, Internet Explorer makes an exception for pages loaded using the localhost address or a loopback address. Pages loaded using one of these techniques are displayed in IE8 mode when the <!DOCTYPE> directive specifies a standards-based document type.