分享资源到qq,sina,豆瓣

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<html>
<div> <a href='javascript:doShare(7714,"sina")'>add</a></div>
</html>
    
<script type="text/javascript">
var share_postid = -1;
var postArray = [];
function doShare(share_postid,stype){
stitle = postArray[share_postid][0];
surl = postArray[share_postid][1];
sdire = postArray[share_postid][2];
sbanner = postArray[share_postid][3];

blogtitle = '导航犬';
bloghome = 'http://www.navidog.cn';
articletitle = stitle;

stitle = blogtitle + ' - ' + stitle;

switch(stype){
case "fav":
if (document.all){
window.external.addFavorite(surl,stitle);
}
else if (window.sidebar){
window.sidebar.addPanel(stitle,surl, "");
}
else{
alert("抱歉,您的浏览器不支持添加到收藏夹,换个浏览器试试?");
}
break;
case "qqt":
u=encodeURIComponent(surl);
t=encodeURIComponent('#导航犬#:@导航犬 - ' + articletitle);
b=encodeURIComponent(sbanner);
su=encodeURIComponent(bloghome);
window.open('http://v.t.qq.com/share/share.php?title='+t+'&url='+u+'&source=1000012&site='+su+'&pic='+b,'_blank');
break;
case "qzone":
var p = {
url:surl,
desc:"#导航犬#导航犬阅读了这篇文章,觉得不错,分享给大家:)",
summary:sdire,
title:stitle,
site:'导航犬 http://www.navidog.cn',
pics:sbanner
};
var s = [];
for(var i in p){
s.push(i + '=' + encodeURIComponent(p[i]||''));
}
window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?'+s.join('&'));
break;
case "renren":
u=encodeURIComponent(surl);
t=encodeURIComponent(stitle);
window.open('http://share.renren.com/share/buttonshare.do?link='+u+'&title='+t+'source=&sourceUrl=','_blank');
break;
case "douban":
u=encodeURIComponent(surl);
t=encodeURIComponent(stitle);
window.open('http://www.douban.com/recommend/?url='+u+'&title='+t,'_blank');
break;
case "sina":
u=encodeURIComponent(surl);
t=encodeURIComponent(stitle);
window.open('http://service.weibo.com/share/share.php?url='+u+'&title='+t,'_blank');
break;
}
}
</script>




<script>postArray[7714]=[];postArray[7714][0]="创意改变世界-“全球暖化”企鹅杯公益之行";postArray[7714][1]="http://www.navidog.cn/?p=7714";postArray[7714][2]="百万微爱全球暖化项目后续报道—“创意改变世界”-------“设计有爱 ";postArray[7714][3]="http://www.navidog.cn/";</script>

转载于:https://my.oschina.net/u/820238/blog/181137

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值