Created
January 7, 2019 19:09
-
-
Save danielstgt/b39dc871beee783b684a77b0aa7e2ed2 to your computer and use it in GitHub Desktop.
Detect Internet Explorer
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 isIE() { | |
var ua = window.navigator.userAgent; | |
var msie = ua.indexOf('MSIE '); | |
var trident = ua.indexOf('Trident/'); | |
return (msie > 0 || trident > 0); | |
} | |
if (isIE()) { | |
document.getElementById('ie-notice').style.display = 'block'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage