Check if user is using IE with compatibility mode

Go To StackoverFlow.com

8

I am looking for some code (either PHP or JavaScript) would work well to check if a user viewing a page is using compatibility mode.

Then I can use that code to do some conditional statements, or basically give them a notification to turn it off.

2012-04-04 22:13
by Bobby S
related links on right not help?--- - Dan 2012-04-04 22:16
You can use document.documentMode in javascript. See http://msdn.microsoft.com/en-us/library/cc196988%28VS.85%29.aspx for more details - Elian Ebbing 2012-04-04 22:20


11

Force them to:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

This will disable Compatibility View, unless the user then goes and specifically turns it off by going into the Developer Tools and changing it.

2012-04-04 22:16
by Niet the Dark Absol
Sounds awesome, thanks for this - Bobby S 2012-04-04 22:34


0

I use:

try{ JSON } catch (e){ alert("Compatibility Mode Detected")  }
2012-12-12 22:06
by Brian McGinity
Ads