shuchengliang
7/13/2014 - 1:30 PM

判断是什么设备访问,判断是否是ie9以下

判断是什么设备访问,判断是否是ie9以下


function checkBrowser(){
	var device = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
	if(device){
		document.location.href='wap/wap.html';
	}
    if(navigator.appName=="Microsoft Internet Explorer"){
        var version = navigator.appVersion.split(";"),
        trim_Version = version[1].split(" MSIE ")[1];
        if(trim_Version<10){
            window.location.href="error.html";
        }
    }
}
checkBrowser();