开发者

JavaScript returning wrong IE version

I have a small Ja开发者_Python百科vaScript 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)));
    }
}


Maybe your browser is running in IE 7 compatible mode?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜