zoukankan      html  css  js  c++  java
  • 扫描二维码跳转app

    1、判断是否安装了app

    <html>
    <head>
    <meta name="viewport" content="width=device-width" />
    </head>
    <body>
    <h2><a id="applink1" href="mtcmtc://profile/116201417">Open scheme(mtcmtc) defined in iPhone with parameters </a></h2>
    <h2><a id="applink2" href="unknown://nowhere">open unknown with fallback to appstore</a></h2>
    <p><i>Only works on iPhone!</i></p>

    <script type="text/javascript">
    // To avoid the "protocol not supported" alert, fail must open another app.
    var appstore = "itms://itunes.apple.com/us/app/facebook/id284882215?mt=8&uo=6";
    function applink(fail){
    return function(){
    var clickedAt = +new Date;
    // During tests on 3g/3gs this timeout fires immediately if less than 500ms.
    setTimeout(function(){
    // To avoid failing on return to MobileSafari, ensure freshness!
    if (+new Date - clickedAt < 2000){
    window.location = fail;
    }
    }, 500);
    };
    }
    document.getElementById("applink1").onclick = applink(appstore);
    document.getElementById("applink2").onclick = applink(appstore);
    </script>
    </body>
    </html>

    2、打开项目工程target里面的schemurl追加://

    转载文章:http://blog.csdn.net/hundsong/article/details/6623500#

  • 相关阅读:
    Tempter of the Bone 搜索---奇偶性剪枝
    uestc 1709 Binary Operations 位运算的灵活运用
    uestc 1072 a ^ b
    uestc Another LCIS
    武汉邀请赛 Key Logger 双向链表
    bnu 29378 Adidas vs Adivon 基础题
    中南月赛F ZZY and his little friends
    日期问题
    开灯问题
    开灯问题
  • 原文地址:https://www.cnblogs.com/sgdkg/p/4179584.html
Copyright © 2011-2022 走看看