366API Analysis: micro letter how to share links APP judgment opens in your default browser

Do app to share micro-page letter, if the phone has this APP installed on the show "Open Application" button, if there is no app installed on the phone display the "Download Application" button. But if you open this link in a micro-channel environment can not be downloaded and wake APP, so to add to determine if a user opens a micro letter, you need to jump browser to open the download link or wake APP!

Android phones can now be achieved, then by clicking on the link to jump directly to a micro-channel. The phone automatically opens the default browser

Open 366API URLs follow the steps can be realized.

Source may refer to:

<!DOCTYPE html>
<html xmlns="http://www.mindjump.cn/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>loading</title>
        <script type=text/javascript src="http://libs.baidu.com/jquery/1.9.0/jquery.min.js"></script>
    </head>
    
    <body>
        
        
    <script type="text/javascript">
        $(function () {
            get_share();
        });
        
        function get_share(){
            var user = getQueryString('user');
            var url = getQueryString('url');
            $.ajax({
             type: "get",
             async: false,
             url: 'http://api.weixin139.com/jumpurl/index/get_url.html',
             data:{user:user,url:url},
             dataType: "jsonp",
             jsonp: "callback",
             jsonpCallback:"checkHandler",
             success: function(data){
                 window.location.href=data.url;
             },
         });
        }
        
        function getQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]);
            return null;
        }
 
        </script>
 
    </body>
</html>

 

Guess you like

Origin www.cnblogs.com/oppis/p/10956601.html