一键分享代码

时间:2023-01-30 07:36:00

腾讯QQ的微博分享代码:

<a href="javascript:void(0)" onclick="postToWb();" class="tmblog"><img src="http://v.t.qq.com/share/images/s/b24.png" border="0"></a>
<script type="text/javascript">
  function postToWb(){
   var _t = encodeURI(document.title);
   var _url = encodeURI(document.location);
   var _appkey = encodeURI("appkey");//你从腾讯获得的appkey
   var _pic = encodeURI('');//(列如:var _pic='图片url1|图片url2|图片url3....)
   var _site = '';//你的网站地址
   var _u = 'http://v.t.qq.com/share/share.php?title='+_t+'&url='+_url+'&appkey='+_appkey+'&site='+_site+'&pic='+_pic;
   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:(function(){window.open('http://v.t.sina.com.cn/share/share.php?
title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(location.href)
+'&source=bookmark','_blank','width=450,height=400');})()" title="新浪微博分享"><img 
src="http://www.cyseo.org/upload/sina.gif"  alt="新浪微博" border="0"></a>

搜狐的微博分享代码:

<a title="分享到搜狐微博" 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'));" style="margin:0 0 0 20px;font-size:12px;font-family:'\5b8b\4f53';color:#369"><span style="display:inline-block;width:16px;height:16px;margin:0 3px 0.2em -20px;vertical-align:middle;background:url(http://s2.cr.itc.cn/img/t/152.png) no-repeat"></span>搜狐微博</a>

网易的微博分享代码:

<a title="分享到网易微博" target="_self" onclick="(function(){var url = 'link=http://news.163.com/&amp;source='+ encodeURIComponent('网易新闻')+ '&amp;info='+ encodeURIComponent(document.title) + ' ' + encodeURIComponent(document.location.href);window.open('http://t.163.com/article/user/checkLogin.do?'+url+'&amp;'+new Date().getTime(),'newwindow','height=330,width=550,top='+(screen.height-280)/2+',left='+(screen.width-550)/2+', toolbar=no, menubar=no, scrollbars=no,resizable=yes,location=no, status=no');})()" href="javascript:void(0);"><img height="19px" border="0″ align="absMiddle" src="http://img1.cache.netease.com/cnews/css09/wblog.gif" />网易微博</a>