I test the code from the microsoft company site, but it defines my IE as the seventh version, although I have the eighth version (written in the About clause). What's wrong?
function getInternetExplorerVersion() { var rv = -1; if (navigator.appName == 'Microsoft Internet Explorer') { var ua = navigator.userAgent; var re = new RegExp('MSIE ([0-9]{1,}[\.0-9]{0,})'); if (re.exec(ua) != null) rv = parseFloat(RegExp.$1); } return rv; } This code is for IE only.
IE version 6 is detectable.
What is the reason?
the contents of the variable ua:


document.documentMode- Sublihimcompatible; MSIE 7.0compatible; MSIE 7.0Open the console and see what really is your compatibility mode. And add to the question the full HTML code that you check. Rather, you can onlyDOCTYPE- Grundy