Check if user is using IE with compatibility mode
Asked Answered
A

2

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.

Aristotle answered 4/4, 2012 at 22:13 Comment(2)
related links on right not help?--->Megaton
You can use document.documentMode in javascript. See msdn.microsoft.com/en-us/library/cc196988%28VS.85%29.aspx for more details.Solan
I
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.

Invective answered 4/4, 2012 at 22:16 Comment(0)
P
0

I use:

try{ JSON } catch (e){ alert("Compatibility Mode Detected")  }
Profiterole answered 12/12, 2012 at 22:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.