转发至新浪微博、开心网、腾讯微博、人人网代码分享!
2012-02-02 17:36
274 查看
转载地址: http://www.renseng.com/learning/forwarded-sina-happy-tencent-sharing-network.html
用以下代码前如有需求可申请新浪微博跟腾讯微博的APPKEY,点这里申请新浪微博,点这里申请腾讯微博,申请后即可替换以下代码中的appkey。
新浪微博分享代码:
<a href="javascript:void((function(s,d,e){try{}catch(e){}var f='http://v.t.sina.com.cn/share/share.php?',u=d.location.href,p=['url=',e(u),'&title=',e(d.title),'&appkey=3486983565'].join('');function
a(){if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=620,height=450,left=',(s.width-620)/2,',top=',(s.height-450)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})(screen,document,encodeURIComponent));"
title="分享到新浪微博" class="s1"> </a>
腾讯微博分享代码:
<a href="javascript:void(0)" onclick="postToWb();" close="tmblog" class="s2" title="分享到腾讯微博"></a>
<script type="text/javascript">
function postToWb(){
var _t = encodeURI(document.title);
var _url = encodeURIComponent(document.location);
var _appkey = encodeURI("571330b45a5044939d9acd6abc0d0a7b");
var _pic = encodeURI('');//(例如:var _pic='图片url1|图片url2|图片url3....)
var _site = 'www.upantool.com';
var _u = 'http://v.t.qq.com/share/share.php?url='+_url+'&appkey='+_appkey+'&site='+_site+'&pic='+_pic+'&title='+_t;
window.open( _u,'', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no' );
}
</script>
搜狐微博分享代码:
<a href="javascript:void((function(s,d,e,r,l,p,t,z,c){var f='http://t.sohu.com/third/post.jsp?',u=z||d.location,p=['&url=',e(u),'&title=',e(t||d.title),'&content=',c||'gb2312','&pic=',e(p||'')].join('');function%20a(){if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=660,height=470,left=',(s.width-660)/2,',top=',(s.height-470)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent,'','','','','','utf-8'));"
title="分享到搜狐微博" class="s3"> </a>
人人网分享代码:
<a href="javascript:window.open('http://share.renren.com/share/buttonshare.do?title='+encodeURIComponent(document.title.substring(0,76))+'&link='+encodeURIComponent(location.href)+'&content=','_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes');
void 0" title="分享到人人网" class="s4"> </a>
开心网分享代码:
<a href="javascript:window.open('http://www.kaixin001.com/repaste/share.php?rtitle='+encodeURIComponent(document.title.substring(0,76))+'&rurl='+encodeURIComponent(location.href)+'&rcontent=','_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes');
void 0" title="分享到开心网" class="s5"> </a>
豆瓣网分享代码:
<a href="javascript:void(function(){var%20d=document,e=encodeURIComponent,s1=window.getSelection,s2=d.getSelection,s3=d.selection,s=s1?s1():s2?s2():s3?s3.createRange().text:' ',r='http://www.douban.com/recommend/?url='+e(d.location.href)+'&title='+e(d.title)+'&sel='+e(s)+'&v=1',x=function(){if(!window.open(r,'douban','toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=330'))location.href=r+'&r=1'};if(/firefox/.test(navigator.userAgent)){setTimeout(x,0)}else{x()}})()"
title="分享到豆瓣网" class="s6"> </a>
用以下代码前如有需求可申请新浪微博跟腾讯微博的APPKEY,点这里申请新浪微博,点这里申请腾讯微博,申请后即可替换以下代码中的appkey。
新浪微博分享代码:
<a href="javascript:void((function(s,d,e){try{}catch(e){}var f='http://v.t.sina.com.cn/share/share.php?',u=d.location.href,p=['url=',e(u),'&title=',e(d.title),'&appkey=3486983565'].join('');function
a(){if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=620,height=450,left=',(s.width-620)/2,',top=',(s.height-450)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})(screen,document,encodeURIComponent));"
title="分享到新浪微博" class="s1"> </a>
腾讯微博分享代码:
<a href="javascript:void(0)" onclick="postToWb();" close="tmblog" class="s2" title="分享到腾讯微博"></a>
<script type="text/javascript">
function postToWb(){
var _t = encodeURI(document.title);
var _url = encodeURIComponent(document.location);
var _appkey = encodeURI("571330b45a5044939d9acd6abc0d0a7b");
var _pic = encodeURI('');//(例如:var _pic='图片url1|图片url2|图片url3....)
var _site = 'www.upantool.com';
var _u = 'http://v.t.qq.com/share/share.php?url='+_url+'&appkey='+_appkey+'&site='+_site+'&pic='+_pic+'&title='+_t;
window.open( _u,'', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no' );
}
</script>
搜狐微博分享代码:
<a href="javascript:void((function(s,d,e,r,l,p,t,z,c){var f='http://t.sohu.com/third/post.jsp?',u=z||d.location,p=['&url=',e(u),'&title=',e(t||d.title),'&content=',c||'gb2312','&pic=',e(p||'')].join('');function%20a(){if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=660,height=470,left=',(s.width-660)/2,',top=',(s.height-470)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent,'','','','','','utf-8'));"
title="分享到搜狐微博" class="s3"> </a>
人人网分享代码:
<a href="javascript:window.open('http://share.renren.com/share/buttonshare.do?title='+encodeURIComponent(document.title.substring(0,76))+'&link='+encodeURIComponent(location.href)+'&content=','_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes');
void 0" title="分享到人人网" class="s4"> </a>
开心网分享代码:
<a href="javascript:window.open('http://www.kaixin001.com/repaste/share.php?rtitle='+encodeURIComponent(document.title.substring(0,76))+'&rurl='+encodeURIComponent(location.href)+'&rcontent=','_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes');
void 0" title="分享到开心网" class="s5"> </a>
豆瓣网分享代码:
<a href="javascript:void(function(){var%20d=document,e=encodeURIComponent,s1=window.getSelection,s2=d.getSelection,s3=d.selection,s=s1?s1():s2?s2():s3?s3.createRange().text:' ',r='http://www.douban.com/recommend/?url='+e(d.location.href)+'&title='+e(d.title)+'&sel='+e(s)+'&v=1',x=function(){if(!window.open(r,'douban','toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=330'))location.href=r+'&r=1'};if(/firefox/.test(navigator.userAgent)){setTimeout(x,0)}else{x()}})()"
title="分享到豆瓣网" class="s6"> </a>
相关文章推荐
- 通过JavaScript打开网页方式进行分享-转最简单易用的开心网、人人网、新浪微博、腾讯微博、QQ空间分享代码
- 分享到新浪微博、腾讯微博、QQ空间、开心网、人人网、豆瓣网
- 一键分享到新浪微博、腾讯微博、搜狐微博、人人网、开心网、百度收藏等js代码大全
- 新浪微博、腾讯微博、QQ空间、人人网、豆瓣 一键分享API
- QQ空间、新浪微博、腾讯微博、豆瓣等一键分享API链接代码
- Android 分享到腾讯微博,新浪微博,信息,等等的实现方式
- JavaScript分享新浪微博、QQ空间、腾讯微博
- QQ空间、新浪微博、腾讯微博等一键分享API链接代码
- 分享到QQ空间、新浪微博、腾讯微博的代码
- Windows Phone 社交分享SDK发布(新浪微博、腾讯微博、人人)
- 友盟分享——微信、腾讯微博、新浪微博分享失败原因分析
- 实战新浪微博、腾讯微博的分享功能(转)
- 文章分享到新浪微博,人人网,开心网和天涯社区的代码
- 分享到新浪微博,腾讯微博,网易微博,开心,人人,豆瓣
- 网站一键分享到新浪微博QQ空间腾讯微博
- js分享代码(新浪微博,腾讯微博,QQ空间,QQ好友)
- Android分享到腾讯微博,信息,新浪微博等等,的实现方式
- QQ空间、新浪微博、腾讯微博等一键分享API链接代码
- 分享到QQ空间、新浪微博、腾讯微博和人人网
- Windows Phone 社交分享SDK发布(新浪微博、腾讯微博、人人)