[Share] micro letter h5-line parsing the page jump to label the phone default browser implementation

Recently encountered a need to find my friend make a chat box in the micro letter, number or menu publish a public link or two-dimensional code. Out of a specified micro-channel open our own page,

Our team went to get information on research programs separately after this demand, through the development of micro-channel document, the document Tencent third-party developers, we have had access to the information but in the end only to find some information that is historical past we can now have all closed,

Find the block long before some of the older generation to share on the network. We have to be improved.

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. This function is to use the micro-channel api interface to share a free test of the following interfaces for everyone.
First mindjump open a free test interface privilege and press the page step by step by step operation can be. 

Share section of source code for your reference:

<!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/klliy/p/10963349.html