Internet Explorer version detection in Javascript
 
This article describes easy IE detection in Javascript. Normally you would use tags like these in HTML:
<!--[if IE 8]>...<![endif]--> = IE8
<!--[if lt IE 8]>...<![endif]--> = IE7 or below
<!--[if gte IE 8]>...<![endif]--> = greater than or equal to IE8


The following conditions allow javascript based filtering:

Conditions

10 or older: document.all
9 or older: document.all && !window.atob
8 or older: document.all && !document.addEventListener
7 or older: document.all && !document.querySelector
6 or older: document.all && !window.XMLHttpRequest
5.x: document.all && !document.compatMode


Example code

Only IE7 and older:
if (document.all && !document.querySelector) {
  alert('IE7 or older');
}


IE8, but not in IE7 or IE9+:
if (document.all && document.querySelector && !document.addEventListener) {
  alert('IE8');
}


IE11+ or not IE:

if (!document.all) {
  alert('IE11+ or not IE');
}



Source: http://tanalin.com/en/articles/ie-version-js/
 
admin / Nov 01, 2014
   
 
 
Login: 
Pass: 
 
 
     
     
2004 - 2019 / lookass.ch
makememad@lookass.ch