最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

手机浏览器判断当前手机中是否安装了某app应用,如果app已经安装则打开app,如果尚未安装app,则跳转到app对应的下载地址页面。

业界 admin 48浏览 0评论
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>正在跳转...</title>
</head>
<body>
   <script>
      var url = "http://op.inews.qq/m/news_download?src=3948&os=android&refer=100000308";
      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 = "http://ios_downpage";
            } else {
               window.close();
            }
         },
         25);
         window.location = url;
      } else if (navigator.userAgent.match(/android/i)) {
         window.location.href = url;
         window.setTimeout(function () {  
               window.location.href = "http://android_downpage";
           }, 3000);
      }
   </script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>正在跳转...</title>
</head>
<body>
   <script>
      var url = "http://op.inews.qq/m/news_download?src=3948&os=android&refer=100000308";
      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 = "http://ios_downpage";
            } else {
               window.close();
            }
         },
         25);
         window.location = url;
      } else if (navigator.userAgent.match(/android/i)) {
         window.location.href = url;
         window.setTimeout(function () {  
               window.location.href = "http://android_downpage";
           }, 3000);
      }
   </script>
</body>
</html>
发布评论

评论列表 (0)

  1. 暂无评论