下载判断Android和iOS

时间:2022-07-06 17:15:04

//下载
function down(){
var url = '';
var u = navigator.userAgent, app = navigator.appVersion;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端或者uc浏览器
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
$(".load").click(function(){
if(isiOS){
url='https://m.zhangle.com/downloads/index.html?client=cft06';
window.open(url);
}else{
var ua = navigator.userAgent;
if(ua.indexOf('MicroMessenger') > -1){
$(".mask2").show();
}
else{
url='http://go.163.com/2016/0420/o/htscCFTNewHQApp_NetEase_6288_channel_cft.06.apk';
window.open(url);
}
}
return false;
});
}
down();