javascript - 手机端web页面,怎么判断ios是否安装了某个app?
学习ing
学习ing 2017-07-01 09:12:24
0
1
1004

手机端web页面,怎么判断ios是否安装了某个app?

学习ing
学习ing

全部回复(1)
typecho

这个问题segmentfault上有. IOS 网页能判断有没有安装应用
很久没去看了. 试试:

<script language="javascript">  
 if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {  
  var loadDateTime = new Date();  
  window.setTimeout(function() {  
   var timeOutDateTime = new Date();  
   if (timeOutDateTime - loadDateTime < 5000) {  
    window.location = "要跳转的页面URL";  
   } else {  
    window.close();  
   }  
  },  
  25);  
  window.location = " apps custom url schemes ";  
 } else if (navigator.userAgent.match(/android/i)) {  
  var state = null;  
  try {  
   state = window.open("apps custom url schemes ", '_blank');  
  } catch(e) {}  
  if (state) {  
   window.close();  
  } else {  
   window.location = "要跳转的页面URL";  
  }  
 }  
</script> 
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!