判断ie浏览器版本过低 跳转页面

// 浏览器ie浏览器版本过低 跳转页面(ie9及ie9以下)
(function(window) {
    var theUA = window.navigator.userAgent.toLowerCase();
    if ((theUA.match(/msie\s\d+/) && theUA.match(/msie\s\d+/)[0]) || (theUA.match(/trident\s?\d+/) && theUA.match(/trident\s?\d+/)[0])) {
        var ieVersion = theUA.match(/msie\s\d+/)[0].match(/\d+/)[0] || theUA.match(/trident\s?\d+/)[0];
        if (ieVersion <= 9) {
            window.location.href="跳转的页面";
        }
    }
})(window);

欢迎分享本文,转载请保留出处:前端ABC » 判断ie浏览器版本过低 跳转页面

分享到:更多 ()

发表评论 0