zoukankan      html  css  js  c++  java
  • webapp 启动 手机app

    <div class="downLoad clearfix">
    <div onclick="jsOpenApp.Close(this);" class="downClose fl"></div>
    <img class="fl downLogo" src="/Content/M/New/image/downLogo.png" alt="">
    <span class="fl downTxt">下载麦乐购客户端<br>更多优惠,快到碗里来!</span>
    <a onclick="jsOpenApp.Open(this);" href="http://www.gou.com/app/" class="fr downBtn" >立即领取</a>
    </div>

    <script language="javascript">
    var jsOpenApp=jsOpenApp||{};
    jsOpenApp.Close=function(e){
    $(e).parent().hide();
    };
    jsOpenApp.Open=function(e){
    // 通过iframe的方式试图打开APP,如果能正常打开,会直接切换到APP,并自动阻止a标签的默认行为
    // 否则打开a标签的href链接
    var ifr = document.createElement('iframe');
    var u = navigator.userAgent, app = navigator.appVersion;
    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端或者uc浏览器
    var isiOS = !!u.match(/(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
    var src="";
    if (isAndroid) {
    $(e).attr("href","http://a.app.qq.com/o/simple.jsp?pkgname=com.mrocker.m6go");
    src = "m6gocom://";
    } else if (isiOS) {
    //如果是IOS系统则指向itunes否则进入统一的app下载页
    $(e).attr("href","https://itunes.apple.com/cn/app/qq-2011/id681580740?mt=8");
    src = "mailegou://";
    }
    ifr.src = src;
    ifr.style.display = 'none';
    document.body.appendChild(ifr);
    window.setTimeout(function () {
    document.body.removeChild(ifr);
    }, 3000);
    };
    </script>

  • 相关阅读:
    Kubernetes服务目录的设计
    浅谈移动边缘计算
    kubernetes源码分析 -- kube-proxy
    openstack dpdk
    KVM irqfd and ioeventfd
    dpdk CUSE
    《springboot实战》丁雪峰翻译 笔记
    photoshop
    office word使用
    baidu地图api使用
  • 原文地址:https://www.cnblogs.com/taiyonghai/p/4741716.html
Copyright © 2011-2022 走看看