Skip to content

Instantly share code, notes, and snippets.

@BesrourMS
Created November 1, 2019 13:18
Show Gist options
  • Save BesrourMS/4cd29132bfbd7f7a12828156f7269dd7 to your computer and use it in GitHub Desktop.
Save BesrourMS/4cd29132bfbd7f7a12828156f7269dd7 to your computer and use it in GitHub Desktop.
Check if user use Internet Explorer
function msieversion() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer, return version number
{
alert('Pour une meilleur utilisation de service, nous vous conseillons de télécharger Google Chrome');
}
return false;
}
if (window.attachEvent && !window.addEventListener) {
msieversion();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment