各种微博分享代码

 

<HTML>

 <HEAD>

  <TITLE>分享我啦</TITLE>

 </HEAD>

 

 <BODY>

  <div class="shareit">收藏和分享:

 

新浪微博

<a href="javascript:(function(){ var urls ='http://wwww.baidu.com';

window.open('http://v.t.sina.com.cn/share/share.php?title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(urls)+'&source=bookmark'+'&pic=images/ico_qq.gif||images/ico_sina.gif||images/ico_qqweibo.gif||images/1ico_sina.gif||images/2ico_sina.gif||images/3ico_sina.gif||images/4ico_sina.gif||images/ico_sina.gif','_blank','width=450,height=400');})()" title="新浪微博分享"> 

<img src="images/ico_sina.gif"  alt="新浪微博分享" border="0"></a> 

 

<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="images/ico_sina.gif" alt="Sina ViVi" border="0"></a>

 

QQ空间

<a href="javascript:void(0);" onclick="window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+encodeURIComponent(document.location.href));return false;" title="分享到QQ空间"><img src="images/ico_qq.gif" border="0" /></a>

 

腾讯微博

<a href="javascript:void(0)" onclick="{ var _t = encodeURI(document.title);  var _url = encodeURI(window.location); var _appkey = '333cf198acc94876a684d043a6b48e14'; var _site = encodeURI; var _pic = ''; 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=580, top=180, left=320, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no' );  };" >

<IMG border=0 alt="转播到腾讯微博" src="images/ico_qqweibo.png" width=16 height=16></a>

搜狐微博

<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'));">

<img src='images/ico_sohuweibo.png' title='分享到搜狐微博' border='0'></a>

 

校内人人网

<a title="转贴到校内人人网" href="javascript:void((function(s,d,e){if(/xiaonei\.com/.test(d.location))return;var%20f='http://share.xiaonei.com/share/buttonshare.do?link=',u=d.location,l=d.title,p=[e(u),'&amp;title=',e(l)].join('');function%20a(){if(!window.open([f,p].join(''),'xnshare',['toolbar=0,status=0,resizable=1,width=626,height=436,left=',(s.width-626)/2,',top=',(s.height-436)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent));"><img src="images/ico_renren.gif" alt="分享到校内人人网" border="0" height="16" width="16"></a>

 

<a title="分享到校内人人网" href="javascript:void((function(s,d,e){if(/renren\.com/.test(d.location))return;var f='http://share.renren.com/share/buttonshare?link=',u=d.location,l=d.title,p=[e(u),'&title=',e(l)].join('');function%20a(){if(!window.open([f,p].join(''),'xnshare',['toolbar=0,status=0,resizable=1,width=626,height=436,left=',(s.width-626)/2,',top=',(s.height-436)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent));"><img src="images/ico_renren.gif" border='0'/></a>

 

开心网

<a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(kaixin=window.open('http://www.kaixin001.com/~repaste/repaste.php?&amp;rurl='+escape(d.location.href)+'&amp;rtitle='+escape(d.title)+'&amp;rcontent='+escape(d.title),'kaixin'));kaixin.focus();" title="转贴到开心网"><img src="images/ico_kaixin.gif" alt="转贴到开心网" border="0"></a>

 

淘宝网

<a href="javascript:void(0)" onclick="javascript:window.open('http://share.jianghu.taobao.com/share/addShare.htm?title='+encodeURIComponent(document.title.substring(0,76))+'&url='+encodeURIComponent(location.href)+'&content=','_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes'); void 0" title="分享到淘宝网"><img src="images/ico_tao.ico" border="0" /></a>

 

QQ书签

<a title="添加到QQ书签" href="javascript:window.open('http://shuqian.qq.com/post?from=3&amp;title='+encodeURIComponent(document.title)+'&amp;uri='+encodeURIComponent(document.location.href)+'&amp;jumpback=2&amp;noui=1','favit','width=930,height=470,left=50,top=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes');void(0)"><img src="images/ico_sina.gif" alt="QQ书签" border="0" height="16" width="16"></a>

百度搜藏

<a title="添加到百度搜藏" href="javascript:u=location.href;t=document.title;t=t.substr(0,76);c=%22%22+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);c=c.substr(0,180);var url=%22http://cang.baidu.com/do/add?it=%22+encodeURIComponent(t)+%22&amp;iu=%22+encodeURIComponent(u)+%22&amp;dc=%22+encodeURIComponent(c)+%22&amp;fr=ien#nw=1%22;window.open(url,'_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes');void 0"><img src="images/ico_sina.gif" alt="百度搜藏" border="0" height="16" width="16"></a>

 

<a title="收藏到Google书签" href="javascript:(function(){var a=window,b=document,c=encodeURIComponent,d=a.open('http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk='+c(b.location)+'&amp;title='+c(b.title),'bkmk_popup','left='+((a.screenX||a.screenLeft)+10)+',top='+((a.screenY||a.screenTop)+10)+',height=420px,width=550px,resizable=1,alwaysRaised=1');a.setTimeout(function(){d.focus()},300)})();"><img src="images/ico_sina.gif" alt="Google书签" border="0" height="16" width="16"></a>

 

<a href="javascript:location='http://translate.google.com/translate?u='%20+%20encodeURIComponent(location);" title="Google Translate" target="_blank"><img src="images/ico_sina.gif" alt="Google Translate" border="0"></a>

 

<a title="添加到雅虎收藏" onclick="window.open('http://myweb.cn.yahoo.com/popadd.html?url='+encodeURIComponent(document.location.href)+'&amp;title='+encodeURIComponent(document.title), 'Yahoo','scrollbars=yes,width=440,height=440,left=80,top=80,status=yes,resizable=yes');" href="javascript:;" rel="nofollow"><img src="images/ico_sina.gif" alt="yahoo收藏" border="0" height="16" width="16"></a>

 

<a title="保存到del.icio.us美味书签" href="javascript:(function(){f='http://delicious.com/save?url='+encodeURIComponent(window.location.href)+'&amp;title='+encodeURIComponent(document.title)+'&amp;v=5&amp;';a=function(){if(!window.open(f+'noui=1&amp;jump=doclose','deliciousuiv5','location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()"><img src="images/ico_sina.gif" alt="Del.icio.us" border="0" height="16" width="16"></a>

 

<a title="推荐到digg.com" href="javascript:location.href='http://digg.com/submit?phase=2&amp;url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title)"><img src="images/ico_sina.gif" alt="digg" border="0"></a>

 

<a href="javascript:void(location.href='https://twitter.com/home?status=Now%20reading%20<<'+encodeURIComponent(document.title)+'>>%20'+encodeURIComponent(location.href))" title="分享到 Twitter"><img src="images/ico_sina.gif" alt="分享到twitter" border="0" ></a>

 

<a title="推荐到豆瓣9点" 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)+'&amp;title='+e(d.title)+'&amp;sel='+e(s)+'&amp;v=1&amp;n=1',x=function(){if(!window.open(r,'douban','toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=330'))location.href=r+'&amp;r=1'};if(/Firefox/.test(navigator.userAgent)){setTimeout(x,0)}else{x()}})()"><img src="images/ico_douban.gif" border="0" ></a>

 

<a title="推荐给豆瓣友邻" href="javascript:var u='http://www.douban.com/recommend/?url='+location.href+'&amp;title='+encodeURIComponent(document.title);window.open(u,'douban','toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=330');void(0)"><img src="images/ico_sina.gif" border="0"></a>

 

</div>

 

 

 

腾讯微博

<a target="_self" href="javascript:void(0);" onclick="posttoWb();" style="height: 16px; font-size: 12px; line-height: 16px;" title="分享到腾讯微博"><img src="images/ico_qqweibo.png" border="0"/></a>

<SCRIPT LANGUAGE="JavaScript">

function posttoWb() {

             var _t = '$subject';

             if (_t.indexOf('#') > 0) {

                 _t = encodeURI(_t.substr(0, document.title.indexOf('#')).replace(/\_[\u4E00-\u9FA5]+\_腾讯网/g, ''));

 

             } else {

                 _t = encodeURI(_t.replace(/\_[\u4E00-\u9FA5]+\_腾讯网/g, ''));

             }

             var _source = 1000041;

             var _site = encodeURI('<a href="$db_bbsurl">$db_bbsname</a>');

             var _pic = '';

             var img = document.getElementsByTagName("img");

             for (var i = 0; i < img.length; i++) {

                 _pic += img[i].src + "|";

             }

             var _url = encodeURI(window.location.href);

             if (_url.indexOf('#') > 0) {

                 _url = encodeURI(_url.substr(0, _url.indexOf('#')));

             } else {

                 _url = encodeURI(_url);

             }

             var _appkey = encodeURI("b7da43417b234bfbb21c01162b77b684");

             var _u = 'http://v.t.qq.com/share/share.php?title=' + _t + '&source=' + _source + '&site=' + _site + '&pic=' + _pic + '&url=' + _url + '&appkey=' + _appkey;

             window.open(_u, '腾讯微博', 'width=700, height=680, top=0, left=0, toobar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');

             return false;

         }

 

</SCRIPT>

 

 

 </BODY>

</HTML>

 

你可能感兴趣的:(代码)