function openApp(){
var ua = window.navigator.userAgent.toLowerCase();
//微信
if(ua.match(/MicroMessenger/i) == 'micromessenger'){
window.location.href='****';//这个地方是下载链接
}else{//非微信浏览器
if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
window.location = 'dslangya://';
var ifr = document.createElement("iframe");
ifr.src = "*****://";
ifr.style.display = "none";
document.body.appendChild(ifr);
window.setTimeout(function(){
document.body.removeChild(ifr);
window.location.href = "http://itunes.apple.com/cn/app/******"; /***下载app的地址***/
},2000);
}else if (navigator.userAgent.match(/android/i)) {
//var state = null;
try {
window.location = '*****://';
setTimeout(function(){
window.location= "https://**********"; //android下载地址
},2000);
} catch(e) {}
}
}
}
H5判断手机是否安装app
最新推荐文章于 2024-05-11 19:18:06 发布