In my experience, Internet Explorer has some quirks and nuances that can make working in JavaScript challenging. Often things have to be done differently when dealing with one (or all) of Microsoft’s browsers.
The following snippet is a really simple method of browser sniffing by user-agent, detecting IE 10, 11 or Edge.
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(userAgent) { | |
userAgent = userAgent || navigator.userAgent; | |
return userAgent.indexOf("MSIE ") > -1 || userAgent.indexOf("Trident/") > -1 || userAgent.indexOf("Edge/") > -1; | |
} |
Leave a Reply