首页 > 其他 > 详细

UC浏览器分享文章到朋友圈

时间:2016-04-26 14:06:57      阅读:224      评论:0      收藏:0      [点我收藏+]
<meta charset="utf8"><html>
<body>
    <script src="jquery.min.js"></script>  
    <input type="button" onclick="btnShareFriends()" value=‘分享给微信好友‘> </input>
    <br/> 
    <input type="button" onclick="btnWeixinShare()" value=‘分享到微信朋友圈‘> </input>
    <script type="text/javascript">
		function btnShareFriends() {
			if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && typeof (ucweb) != "undefined") {
				var Browser = new Object();
				Browser.ios = /ios/.test(Browser.userAgent); //判断ios系统 
				var title = "测试分享到朋友圈";
				var img = "";
				var url = location.href;
				if (Browser.ios) {
					ucbrowser.web_share(title, img, url, ‘kWeixin‘, ‘‘, ‘@39yst‘, ‘‘);
				} else {
					ucweb.startRequest("shell.page_share", [title, img, url, ‘WechatFriends‘, ‘‘, ‘‘, ‘‘]);
				} 
			}else{
				alert("请使用手机UC浏览器进行分享");
			}
		}
		function btnWeixinShare(){
			if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && typeof (ucweb) != "undefined") {
				var Browser = new Object();
				Browser.ios = /ios/.test(Browser.userAgent); //判断ios系统 
				var title = "测试分享到朋友圈";
				var img = "";
				var url = location.href;
				if (Browser.ios) {
					ucbrowser.web_share(title, img, url, ‘kWeixinFriend‘, ‘‘, ‘@39yst‘, ‘‘);
				} else {
					ucweb.startRequest("shell.page_share", [title, img, url, ‘WechatTimeline‘, ‘‘, ‘‘, ‘‘]);
				}
			}else{
				alert("请使用手机UC浏览器进行分享");
			}
		}
    </script>
</body>
</html>

  

UC浏览器分享文章到朋友圈

原文:http://www.cnblogs.com/gengting/p/5434802.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!