I am calling a function like the one below by click on divs with a certain class.
Is there a way I can check when starting the function if a user is using Internet
This returns true
for any version of Internet Explorer:
function isIE(userAgent) {
userAgent = userAgent || navigator.userAgent;
return userAgent.indexOf("MSIE ") > -1 || userAgent.indexOf("Trident/") > -1 || userAgent.indexOf("Edge/") > -1;
}
The userAgent
parameter is optional and it defaults to the browser's user agent.