From this link : http://blogs.msdn.com/b/deviations/archive/2009/05/07/how-to-enable-ie-8-compatibility-view-for-your-whole-web-site-or-for-specific-web-site-directories.aspx
The question many customers asked is ”How can I force the client
browser to use the Compatibility View when they visit our site? So
that the customer doesn’t have to activate it on the client side.”
Web Developers and Site Administrators can configure IIS and their
sites to tell Internet Explorer 8 to automatically Emulate Internet
Explorer 7 when they visit their site or just specific WebPages.
This is done by adding a custom HTTP Header to the IIS and the website
web.config or to add a meta tag to specific pages. The HTTP Header is
interpreted by the Internet Explorer 8 which will activate the
compatibility view. All other browsers will simply ignore this custom
HTTP Header.
X-UA-Compatible: IE=EmulateIE7
This is to FORCE rendering in compatibility mode.
If you want to 'simulate' a browser in compatibility mode, user RocketHazmat mentioned what to do (with tools > settings) in a comment.
You can get familiar with this property and the Compatibility View mode of IE8 and IE9 via the following two blogs:
Introducing Compatibility View: http://blogs.msdn.com/b/ie/archive/2008/08/27/introducing-compatibility-view.aspx.
Introducing IE9's User Agent String: http://blogs.msdn.com/b/ie/archive/2010/03/23/introducing-ie9-s-user-agent-string.aspx.
If you want to 'detect' IE compatibility view mode:
i found this SO answer interesting : JavaScript: Can I detect IE9 if it's in IE7 or IE8 compatibility mode? (document.documentMode is the best way). The subject on stackoverflow from a google search.
from this link : http://social.msdn.microsoft.com/Forums/vstudio/en-US/ae715fd2-1ddd-46f7-8c26-9aed6b2103f1/how-to-detect-compatibility-mode-in-ie-any-version
After research, we can find that the values to the User Agent String
under different browse modes are:
- IE7: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1;...)
- IE8: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0;...)
- IE8 Compatibility View: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0;...)
- IE9: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
- IE9 Compatibility View: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0;...)
Note that some irrelevant values in the strings are ignored, we only
need to focus on some critical values which can be combined to decide
the browse mode, like MSIE version NO. and Trident Mode NO..
Here comes the final solution:
var agentStr = navigator.userAgent;
var mode;
if (agentStr.indexOf("Trident/5.0") > -1) {
if (agentStr.indexOf("MSIE 7.0") > -1)
mode = "IE9 Compatibility View";
else
mode = "IE9";
}
else if (agentStr.indexOf("Trident/4.0") > -1) {
if (agentStr.indexOf("MSIE 7.0") > -1)
mode = "IE8 Compatibility View";
else
mode = "IE8";
}
else
mode = "IE7";
document.title = "Browser Mode:\t" + mode;
//document.write(navigator.userAgent);
Something else : stackoverflow.com/questions/11865188/does-the-windows-8-internet-explorer-10-still-have-quirksmode#11865561 where they explain the 2 IE10 quirks mode. Relevant to your situation. Hope it helps.