zoukankan      html  css  js  c++  java
  • js判断移动端是否安装某款app的多种方法

    <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>

    转自:

    http://www.jb51.net/article/76585.htm

  • 相关阅读:
    @atcoder
    @loj
    @AGC037
    @uoj
    @uoj
    @loj
    @loj
    @loj
    @loj
    @loj
  • 原文地址:https://www.cnblogs.com/dongruiha/p/7059816.html
Copyright © 2011-2022 走看看