I have a jQuery code which is working fine for Chrome/Mozilla but not IE.
if ($(\"html\").hasClass(\"ie\")) {
$(function(){
$(\'.green-column, .
The only reliable way to detect the currently active IE version (possibly emulated) is to combine conditional compilation and a document.documentMode check.
Conditional compilation is optional, but it allows you to never run the IE-detection script for non-IE browsers.
For example:
if (/*@cc_on !@*/false && (
document.documentMode === 9 || document.documentMode === 10)
) {
// IE 9 or 10 (not 8 or 11!)
document.documentElement.className += ' ie9 ie10';
}
The previous code is not safe against minifiers. If you're going to minify your code, put the conditional compilation stuff in a string, and eval it:
if (eval('/*@cc_on !@*/false') && ( ... )) { ... }