判断是否是IE6的脚本

IE6就像一个梦魇,挥之不去,我们web程序员都感同身受吧!

var isIE6 = function () {
        if (navigator) {
            var userAgentStr = navigator.userAgent.toLowerCase();
            //alert(userAgentStr.match(/msie ([\d.]+)/));
            if (userAgentStr.match(/msie ([\d.]+)/)) {
                var ua = userAgentStr.match(/msie ([\d.]+)/)[1];
                if (ua == "6.0") {
                    return true;
                }
            } else {
                
            }
        }

        return false;
    }

 

posted on 2013-12-27 10:34  郭长春  阅读(154)  评论(0编辑  收藏  举报

导航