Last active
August 29, 2015 14:09
-
-
Save haukurk/0a4baae335bd93e3a3f7 to your computer and use it in GitHub Desktop.
Check if darn IE compatibility mode is on...
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
<script type="text/javascript"> | |
$(document).ready(function() { | |
// Fix placeholder for stupid IE8 | |
$('input, textarea').placeholder(); | |
var agentStr = navigator.userAgent; | |
var mode; | |
var isCompatON = false; | |
if (agentStr.indexOf("Trident/5.0") > -1) { | |
if (agentStr.indexOf("MSIE 7.0") > -1) { | |
mode = "IE9 Compatibility View"; | |
isCompatON = true; | |
} else | |
mode = "IE9"; | |
} | |
else if (agentStr.indexOf("Trident/4.0") > -1) { | |
if (agentStr.indexOf("MSIE 7.0") > -1) { | |
mode = "IE8 Compatibility View"; | |
isCompatON = true; | |
} else | |
mode = "IE8"; | |
} | |
else | |
mode = "IE7"; | |
if (isCompatON) { | |
alert('This application does not work with IE Compatibility mode. \n Please disable before logging in.'); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment