Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I detect if IE8 is running in compatibility view?

Is there anyway to determine if an IE8 browser has compatibility view switched on?

I can't seem to find anything on Google, and so I'm wondering if this is a piece of information that is available...

Why you ask!? I'm trying to track down a bug in our application. I'm piecing through the Elmah logs and there seems to be a trend; this error is generally thrown by IE8. I tried to repo the defect in my copy of IE8, but couldn't. I want to narrow down the culprits, and thought this might be a way to do it.

like image 317
Gavin Miller Avatar asked Jul 30 '09 19:07

Gavin Miller


People also ask

How do I know if IE 11 is in compatibility mode?

In Internet Explorer 11, you can see if Compatibility Mode is set by clicking on the gear in the upper right-hand corner of the browser and selecting "Compatibility View settings". In the window that pops up, you can see if Compatibility Mode is turned on by seeing if "Use Microsoft compatibility lists" is checked.

How do I test IE8?

Firstly, IE8, IE9, IE10 and IE11 all have developer tools that you can access by pressing F12 whilst in Internet Explorer. These allow you to change your document and browser mode to go back to older rendering engines, which you can find on the emulation tab in the tools.


Video Answer


1 Answers

In Javascript, use document.documentMode

See http://msdn.microsoft.com/en-us/library/cc196988%28VS.85%29.aspx for details.

like image 123
Alohci Avatar answered Sep 25 '22 14:09

Alohci