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.
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.
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.
I use:
try{ JSON } catch (e){ alert("Compatibility Mode Detected") }
© 2022 - 2024 — McMap. All rights reserved.
document.documentMode
in javascript. See msdn.microsoft.com/en-us/library/cc196988%28VS.85%29.aspx for more details. – Solan