Last active
August 29, 2015 13:56
-
-
Save chenwery/9243282 to your computer and use it in GitHub Desktop.
IE version
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
检测IE浏览器的版本 |
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
var isIE = !!window.ActiveXObject; | |
var isIE6 = isIE && !window.XMLHttpRequest; | |
var isIE8 = isIE && !!document.documentMode; | |
var isIE7 = isIE && !isIE6 && !isIE8; | |
if (isIE) { | |
if (isIE6) { | |
alert('ie6'); | |
} else if (isIE8) { | |
alert('ie8'); | |
} else if (isIE7) { | |
alert('ie7'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment