js分享QQ空间,新浪微博,百度,google,人人网,开心网代码
/*
*不要下载这个js文件到你的主机里,因为风吟会不定期更新。
*存放在Google code 托管是很稳定的,不用担心哪天会被和谐。
*我们都应该相信Google..
*/
/*
* Share.js
* Copyright(c) 2009 FengYin
* Date: 2010年1月7日 13:16:17
* Blog: http://fengyin.name/ http://www.111cn.net
* Update: http://code.google.com/p/share-js/
*/
(function(){var a={version:"1.0",build:"1ce010bc1f412fd202df4c0b28b9f380",url:function(){return
encodeURIComponent(window.location.href)},title:function(){return
encodeURIComponent(window.document.title)},content:function(b){if(b){return
encodeURIComponent(document.getElementById(b).innerText)}else
{return""}},setid:function(){if(typeof(shareid)=="undefined"){return null}else
{return shareid}},kaixin:function(){window.open
("http://www.kaixin001.com/repaste/share.php教程?rtitle="+this.title()
+"&rurl="+this.url()+"&rcontent="+this.content(this.setid()))},renren:function()
{window.open("http://share.renren.com/share/buttonshare.do?link="+this.url()
+"&title="+this.title())},sinaminiblog:function(){window.open
("http://v.t.sina.com.cn/share/share.php?url="+this.url()+"&title="+this.title()
+"&content=utf-8&source=&sourceUrl=&pic=")},baidusoucang:function(){window.open
("http://cang.baidu.com/do/add?it="+this.title()+"&iu="+this.url()
+"&dc="+this.content(this.setid())+"&fr=ien#nw=1")},qqshuqian:function()
{window.open("http://shuqian.qq.com/post?from=3&title="+this.title()
+"&uri="+this.url()+"&jumpback=2&noui=1")},gugesghuqian:function(){window.open
("http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk="+this.url()
+"&title="+this.title())},douban:function(){window.open
("http://www.douban.com/recommend/?url="+this.url()+"&title="+this.title()
+"&v=1")},baishehui:function(){window.open
("http://bai.sohu.com/share/blank/addbutton.do?from=fengyin&link="+this.url()
+"&title="+this.title())}};window.share=a})();document.write("将本页分享到: <a
href="网页特效:share.kaixin();">开心网</a> <a href="javascript:share.renren
();">人人网</a> <a href="javascript:share.baishehui();">白社会</a> <a
href="javascript:share.sinaminiblog();">新浪微博</a> <a
href="javascript:share.baidusoucang();">百度搜藏</a> <a
href="javascript:share.qqshuqian();">QQ书签</a> <a
href="javascript:share.gugesghuqian();">谷歌</a> <a
href="javascript:share.douban();">豆瓣</a>");
调用方法很简单,直接把下面内容保存成js然后再到要调用的页面加上这js就成了。
如
上面js我保存成111cn.net.js文件在b.htm调用
<script type="text/javascript" src="http://www.111cn.net/111cn.net.js"></script>这样就KO了。