分享到新浪等

来源:互联网 发布:2016年大数据薪资待遇 编辑:程序博客网 时间:2024/05/16 05:56

代码如下:

分享到: <br>
<a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().te
xt:''):(d.getSelection?d.getSelection():'');void(kaixin=window.open('http://www.kaixin001.com/~re
paste/repaste.php?&rurl='+escape(d.location.href)+'&rtitle='+escape(d.title)+'&rcontent='+escape(
d.title),'kaixin'));kaixin.focus();"><img
src="images/share_2.gif"
alt="转帖到开心网"

border="0" ></a>
<a  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)].joi
n('');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(/Fi
refox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURICom
ponent));"
title="分享到人人"><img
src="images/share_3.gif"
title="分享到人人"/></a>

<a href="javascript: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');void(0)"><img
src='images/share_5.gif'
alt='分享到新浪微博' border='0'></a>

<a href="javascript:window.open('http://shuqian.qq.com/post?from=3&title='+encodeURIComponen
t(document.title)+'&uri='+encodeURIComponent(document.location.href)+'&jumpback=2&noui=
1','favit','');void(0)"><img src="images/qqsq.jpg" alt="qq书签" border="0" ></a>

<a href="javascript:window.open('http://cang.baidu.com/do/add?it='+encodeURIComponent(document.title.substring(0,76))+'&iu='+encodeURIComponent(location.href)+'&fr=ien#nw=1','_blank','scrollbars=no,status=no,resizable=yes');
void 0" ><IMG alt="添加到百度收藏" src="images/baidusc.jpg" border=0></a>

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

这些图片我都是放在了images文件夹下了,用的时候改成自己的路径就行了。

当然这些文件完全可以写在一个文件里,当用的时候直接引入就可以了。比如我在ecshop中使用,只需要将这些代码写在一个文件里面,比如起名叫做share.lbi,如果想再商品详情页显示的话,只需要在合适的位置加上  <!-- #BeginLibraryItem "/library/share.lbi" --><!-- #EndLibraryItem -->即可。

原创粉丝点击