分享到微博js

45 篇文章 0 订阅
3 篇文章 0 订阅
[size=medium]
分享到微博js
[/size]
[size=medium]
1.分享到微博代码:
[/size]


var top = window.screen.height / 2 - 250;
var left = window.screen.width / 2 - 300;

/*title是标题,rLink链接,summary内容,site分享来源,pic分享图片路径,分享到新浪微博*/
function shareTSina(title,rLink,site,pic) {
title = "标题。";
// pic = $(".p-img img").attr("src");
rLink = "http://www.abc.com/heeh.html";

window.open("http://service.weibo.com/share/share.php?pic=" +encodeURIComponent(pic) +"&title=" +
encodeURIComponent(title.replace(/ /g, " ").replace(/<br \/>/g, " "))+ "&url=" + encodeURIComponent(rLink),
"分享至新浪微博",
"height=500,width=600,top=" + top + ",left=" + left + ",toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no");

}

/*,分享到qq空间*/
function shareQzone(title,rLink,summary,site,pic) {
title = "标题。";
rLink = "http://www.abc.com/heeh.html";
site = "http://www.abc.com/heeh.html";
window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?title='+
encodeURIComponent(title)+'&url='+encodeURIComponent(rLink)+'&summary='+
encodeURIComponent(summary)+ '&site='+encodeURIComponent(site)
,'_blank','scrollbars=no,width=600,height=450,left=' + left + ',top=' + top + ',status=no,resizable=yes');

}

/*,分享到人人*/
function shareRR(title,rLink,summary){
title = "标题。";
summary = "内容。";
rLink = "http://www.abc.com/heeh.html";
window.open('http://share.renren.com/share/buttonshare/post/1004?title='+encodeURIComponent(title)+'&url='+
encodeURIComponent(rLink)+'&content='+encodeURIComponent(summary),'_blank',
'scrollbars=no,width=600,height=450,left=' + left + ',top=' + top + ',status=no,resizable=yes');
}


//开心网
function shareKX(title,rLink,summary){
title = "标题。";
rLink = "http://www.abc.com/heeh.html";
window.open('http://www.kaixin001.com/repaste/bshare.php?rtitle='+encodeURIComponent(title)+
'&rurl='+encodeURIComponent(rLink)+
'&rcontent='+encodeURIComponent(summary),'_blank',
'scrollbars=no,width=600,height=450,left=' + left + ',top=' + top + ',status=no,resizable=yes');
}

//腾讯微博
function shareToWb(title,rLink,site,pic){
title = "标题。";
rLink = "http://www.abc.com/heeh.html";
window.open('http://v.t.qq.com/share/share.php?url='+encodeURIComponent(rLink)+
'&title='+encodeURI(title)+'&appkey='+encodeURI(site),'_blank',
'scrollbars=no,width=600,height=450,left=' + left + ',top=' + top + ',status=no,resizable=yes');
}



/*分享到msn*/
function shareToMSN(imgUrl){
var title = "标题。";
var content = "内容";
var productUrl ="http://www.abc.com/heeh.html";

window.open("http://profile.live.com/badge/?url=" + productUrl + "&title=" + encodeURI(title) +"&screenshot="+encodeURIComponent(imgUrl));

}



[color=red]
[size=medium]
2.说明:新浪微博和qq空间会自动获取网站的图片,msn和其他没有此功能,所以想要在msn分享图片,则需手动传图片的url,目前发现msn只能传一张图片,不能手动调节大小。
[/size]
[/color]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值