您的位置:首页 > 移动开发 > Android开发

js 判断是android手机,iphone手机

2014-10-10 16:35 281 查看
function isIphoneMobileDevice(){

var ua = navigator.userAgent.toLowerCase();

if (/iphone|ipod/.test(ua)) {

if(/micromessenger/.test(ua)){

//iphone 手机

document.getElementById("popweixin").style.display = "block";

document.getElementById("elem-Products_mobileShowCase01-001").style.display = "none";

}

}else{

// 跳转连接

window.location.href="";

}

}

function isAndroidMobileDevice(){

var ua = navigator.userAgent.toLowerCase();

if(/android/i.test(ua)){

if(/micromessenger/.test(ua)){

document.getElementById("android").style.display = "block";

document.getElementById("elem-FrontSlide_listJson01-001").style.display = "none";

}else{

window.location.href="****************************************";

}

}else{

window.location.href="***********************************";

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: