---
title: "JS分享微博、QQ空间代码"
author: "yanyanquan"
date: "2014-06-25T13:14:03Z"
tags: []
categories: ["Web前端"]
slug: "js-qq"
draft: false
lastmod: "2014-06-25T13:14:03Z"
id: 2084757
url: "https://kwon.iteye.com/blog/2084757"
---

&lt;span style="font-size:24px;"&gt;var ShareTip = function()

{

  

}

//分享到腾讯微博

ShareTip.prototype.sharetoqq=function(content,url,picurl)

{

 var shareqqstring='http://v.t.qq.com/share/share.php?title='+content+'&url='+url+'&pic='+picurl;

 window.open(shareqqstring,'newwindow','height=100,width=100,top=100,left=100');

}

//分享到新浪微博

ShareTip.prototype.sharetosina=function(title,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');

}

//分享到QQ空间

ShareTip.prototype.sharetoqqzone=function(title,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');

}

&lt;/span&gt;

 

 

 

测试：

 &lt;span style="font-size:18px;"&gt;var share1=new ShareTip();

   share1.sharetoqqzone("这是一本关于地图故事的集锦，以一本书的形式来展示地图故事，我们可以使用鼠标拖动来翻页，或者点击翻页按钮，点击 马上体验，可以体验故事，同时在触屏上也有很好的体验效果奥，地图故事，尽在书中，赶快体验吧，建议使用对 HTML5支持较好的浏览器","http://tm.arcgisonline.cn:8038/App101/MapstoryBook/Default.html","http://tm.arcgisonline.cn:8038/App101/MapstoryBook/css/Img/ShareBook.jpg");&lt;/span&gt;