• H5 判断应用是否打开或是下载


    (function () {
        var openUrl = window.location.search;
        try {
            openUrl = openUrl.substring(1, openUrl.length);
        } catch (e) {
        }
        var isiOS = navigator.userAgent.match('iPad')
          || navigator.userAgent.match('iPhone')
          || navigator.userAgent.match('iPod'), isAndroid = navigator.userAgent
          .match('Android'), isDesktop = !isiOS && !isAndroid;
        if (isiOS) {
            window.location = "[scheme]://[host]?url=" + openUrl;
            setTimeout(function () {
                window.location = "itms-apps://itunes.apple.com/app/[name]/[id]?mt=8";
            }, 25);
    
        } else if (isAndroid) {
            window.location = "intent://[host]/" + "url=" + openUrl + "#Intent;scheme=[scheme];package=[package_name];end";
        } else {
            window.location.href = openUrl;
        }
    })();
  • 相关阅读:
    Prometheus监控k8s集合
    docker集合
    开源堡垒机jumpserver
    ELK日志分析平台
    安全名称解释
    CPU上下文切换
    平均负载
    234. 回文链表
    125. 验证回文串
    122. 买卖股票的最佳时机II
  • 原文地址:https://www.cnblogs.com/yjhua/p/4922761.html
Copyright © 2020-2023  润新知