Last active
December 28, 2015 01:38
-
-
Save headquarters/7421537 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkCompatibilityMode(){ | |
var userAgentRegex = /MSIE ([0-9.]+)/; | |
var userAgentData = userAgentRegex.exec(navigator.userAgent); | |
if(userAgentData != null && typeof userAgentData[1] == "string"){ | |
//userAgentData[1] will hold the version number, e.g. "10.0" | |
if(parseInt(userAgentData[1], 10) != document.documentMode){ | |
$('body').append('<div class="warning">Your browser appears to be in Compatibility Mode. This may cause problems when printing. <a href="http://www.howtogeek.com/128289/how-to-disable-compatibility-mode-in-internet-explorer/" target="_blank">Read how to turn off Compatibility Mode</a>.</div>'); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment