1、分享到新浪微博:
appkey:申请的appkey
shareTitle:分享标题
sharePic:分享图片
shareUrl:分享成功之后返回的地址
------------------代码
location.href="http://service.weibo.com/share/share.php?appkey=“+appkey+”&title="+shareTitle+
"&pic=" + sharePic +"&url=" + encodeURIComponent(shareUrl);
2、分享到腾讯微博
appkey:申请的appkey
shareTitle:分享标题
sharePic:分享图片
shareUrl:分享成功之后返回的地址------------------代码
location.href="http://share.v.t.qq.com/index.php?c=share&a=index&title="+shareTitle+
"&url="+encodeURIComponent(shareUrl)+"&appkey=“+appkey+”&site="+fromUrl +"&pic="+sharePic;
3、分享到qq空间
shareTitle:分享标题
sharePic:分享图片
shareUrl:分享成功之后返回的地址fromUrl:来源
注:summary表示摘要
------------------代码
//打开,因为返回时会关闭
window.open("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?desc=&summary="+encodeURIComponent(shareTitle)
+"&title="+encodeURIComponent(shareTitle) + "&pics=" + encodeURIComponent(sharePic) +
"&url=" + encodeURIComponent(shareUrl) + "&site="+encodeURIComponent(fromUrl));
4、分享到qq好友
shareTitle:分享标题
sharePic:分享图片
shareUrl:分享成功之后返回的地址------------------代码
var p = {
url:shareUrl, /*获取URL,可加上来自分享到QQ标识,方便统计*/
desc:'', /*分享理由(风格应模拟用户对话),支持多分享语随机展现(使用|分隔)*/
title:shareTitle, /*分享标题(可选)*/
summary:shareTitle, /*分享摘要(可选)*/
pics:sharePic, /*分享图片(可选)*/
flash: '', /*视频地址(可选)*/
site:"", /*分享来源(可选) 如:QQ分享*/
style:'201',
width:32,
height:32
};
var s = [];
for(var i in p){
s.push(i + '=' + encodeURIComponent(p[i]||''));
}
window.open("http://connect.qq.com/widget/shareqq/index.html?" + s.join('&'));