您的位置:首页 > 移动开发 > 微信开发

手机直接分享链接到微信

2015-11-20 13:11 423 查看
<script type="text/javascript">
var ua = window.navigator.userAgent,
ua_n = ua.match(/UCBrowser/i),
ua_i = ua.match(/iPhone|iPod|iPad/i);
//仅适用非苹果系统的uc浏览器
if(ua_n && !ua_i){
document.write("<script type=\"text/javascript\" src=\"http://aa.com/jmo/js/ucw.js\"><\/script>");
}
</script>


ucw.js
$("#footerinfo").after('<a class="ucsharebtn" style="background: url(http://aa.com/jmo/images/ucweixin.png) no-repeat scroll center center/25px auto rgba(0, 0, 0, 0.7); border-radius: 2px; display: block; height: 40px; margin-top: 5px; width: 40px; bottom: 70px; position: fixed; right: 15px; z-index: 9;"></a>');

$(".ucsharebtn").click(function(){
var b=document.querySelector("title").innerHTML;
var a=location.href;
ucweb.startRequest("shell.page_share",[b,"",a,"WechatTimeline","","",""])
});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: