码迷,mamicode.com
首页 > Web开发 > 详细

JS 实现新浪微博, QQZone 等的分享

时间:2014-06-18 14:11:31      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:class   blog   java   http   ext   com   

 <script type="text/javascript">window.pageConfig = { compatible: true,searchType: 1 }; </script>
	
	<script type="text/javascript">
		
		var t_url = "http://192.168.1.105:8080/MyHBook/";
		
		function convertURL(url) {
			return t_url + url;
		}
		function convertPicUrl(picurl) {
			return t_url + picurl;
		}
		//分享到新新浪微博
		function shareWeiBo(title,url,picurl){
			//alert(">>>");
			//alert(title + " : " + url + " : " + picurl);
			url = convertURL(url);
			picurl = convertPicUrl(picurl);
			//alert(url + " : " + picurl);
			var sharesinastring=‘http://v.t.sina.com.cn/share/share.php?title=‘+title+‘&url=‘+url+‘&content=utf-8&sourceUrl=‘+url+‘&pic=‘+picurl;  
			 window.open(sharesinastring,‘newwindow‘,‘height=400,width=400,top=100,left=100‘);
		}
		//分享到腾讯微博
		function shareTCWeiBo(title,url,picurl){
			//alert(">>>");
			//alert(title + " : " + url + " : " + picurl);
			 url = convertURL(url);
			 picurl = convertPicUrl(picurl);
			var shareqqstring=‘http://v.t.qq.com/share/share.php?title=‘+title+‘&url=‘+url+‘&pic=‘+picurl;  
			 window.open(shareqqstring,‘newwindow‘,‘height=400,width=400,top=100,left=100‘);  
		}
		//分享到QQ空间  
		function shareQZone(title,url,picurl)  { 
			 url = convertURL(url);
			 picurl = convertPicUrl(picurl);
			 //alert(url + " : " + picurl);
			 var shareqqzonestring=‘http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?summary=‘+title+‘&url=‘+url+‘&pics=‘+picurl;  
			 window.open(shareqqzonestring,‘newwindow‘,‘height=400,width=400,top=100,left=100‘);  
		}  
	</script>

  

 

JS 实现新浪微博, QQZone 等的分享,布布扣,bubuko.com

JS 实现新浪微博, QQZone 等的分享

标签:class   blog   java   http   ext   com   

原文地址:http://www.cnblogs.com/E-star/p/3791499.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!