cordova 在APP内打开

来源:互联网 发布:淘宝网蓝月亮洗衣液 编辑:程序博客网 时间:2024/05/29 17:02


示例图

点击 在APP内打开触发的事件

    //在APP内打开    $(".openapp").live('click',function(){             alert(window.location.href);             var appUrl = "touzizhanapp://" + window.location.href;             window.location.href = appUrl;    });

在index.html中调试,是否获取到对应的URL

<script>           window.handleOpenURL = function(url){               setTimeout(function(){                   alert(url);               },0);           }        </script>

参考文献:
1.https://github.com/EddyVerbruggen/Custom-URL-scheme
2.http://www.jianshu.com/p/0180e3ee8108
3.http://blog.csdn.net/lovelyelfpop/article/details/48368923

0 0
原创粉丝点击