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
I just wanted to check if the browser was IE11 or older, because well, they're crap.
function isCrappyIE() {
var ua = window.navigator.userAgent;
var crappyIE = false;
var msie = ua.indexOf('MSIE ');
if (msie > 0) {// IE 10 or older => return version number
crappyIE = true;
}
var trident = ua.indexOf('Trident/');
if (trident > 0) {// IE 11 => return version number
crappyIE = true;
}
return crappyIE;
}
if(!isCrappyIE()){console.table('not a crappy browser);}