javascript - js如何识别app应用是否已安装?
本文介绍了javascript - js如何识别app应用是否已安装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
$(".a").click( function (){
var agentUser = navigator.userAgent;
if (agentUser.indexOf('iPhone')>-1 || agentUser.indexOf('iPod')>-1 || agentUser.indexOf('iPad')>-1) {
$(this).prop('href','KingTalentApp://')
window.setTimeout(function () {
window.location.href = 'itms-apps://itunes.apple.com/us/app/jin-ying-jie/id1184103156?l=zh&ls=1&mt=8';
}, 1000);
}
else if( agentUser.indexOf('Android')>-1 || agentUser.indexOf('Lindex')>-1)
{
$(this).prop('href','jinyingjie://app.jinyingjie')
window.setTimeout(function () {
window.location.href = 'http://www.jinyingjie.com/Uploads/jinyingjie.apk';
}, 1000);
}
})
在网上找的代码 苹果没有问题 但是安卓手机总是有些机型识别不了 不太灵
解决方案
在安卓上有时不行 但是过半天又行了 不知道咋回事
另一部手机就是一直不行
这篇关于javascript - js如何识别app应用是否已安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文