I have a small JavaScript function that is supposed to return the IE version.
Problem is, when I publish and view the site this function is returning 7.
I am viewing the site with IE 8.0.7600.16385.
What's going on?
function getIEVersionNumber() {
var ua = navigator.userAgent;
var MSIEOffset = ua.indexOf("MSIE ");
if (MSIEOffset == -1) {
return 0;
} else {
return parseFloat(ua.substring(MSIEOffset + 5, ua.indexOf(";", MSIEOffset)));
}
}
alert(navigator.userAgent)
to see what the page is getting.navigator.userAgent
contain?navigator.userAgent
it reports IE 8. gotta be compatibility mode.