分享到新浪微博,腾讯微博,网易微博,开心,人人,豆瓣
转载地址:http://www.cnblogs.com/bennman/archive/2011/05/28/2060910.html 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <title>分享到新浪微博,腾讯微博,网易微博,开心,人人,豆瓣</title> 6 </head> 7 <body> 8 <div id="shareList"> <span>分享到:</span> 9 <a href="javascript:void(0)" name="tqq">QQ微博</a> 10 <a href="javascript:void(0)" name="sina">新浪微博</a> 11 <a href="javascript:void(0)" name="kaixin">开心网</a> 12 <a href="javascript:void(0)" name="renren">人人网</a> 13 <a href="javascript:void(0)" name="douban">豆瓣</a> 14 <a href="javascript:void(0)" name="t163">163</a> 15 </div> 16 <script type="text/javascript"> 17 var product = { 18 "name":'肯德基96元超级全家桶超值特卖:新奥尔良烤翅1对&中杯可乐1杯;德克萨斯风味烤鸡腿堡+香辣鸡翅2块+九珍果汁1杯;中杯可乐1杯;或香辣/劲脆鸡腿堡1个+德克萨斯浓香风味鸡翅2块+九珍果汁1杯', 19 "shortname":"肯德基超级全家桶", 20 "image":"http://www.4008823823.com.cn/kfc/productpics/2011May/images/kjtb.jpg", 21 "address":"北京", 22 "url":document.location.href 23 }; 24 var a=document.getElementById('shareList').getElementsByTagName('a'); 25 for(var i=0;i<a.length;i++){ 26 a[i].onclick=function(){ 27 if(typeof(share)=='function'){share(this.name,product); 28 } 29 }; 30 /* 31 1.appkey为你在各开放平台注册密钥 32 2.人人和豆瓣本地链接无法测试 33 3.【】里为你的微博账号 34 4.product里为你要分享的内容 35 */ 36 function share(name,product){ 37 if(typeof(product)!='undefined'&&product!=''){ 38 switch(name){ 39 //sina 40 case 'sina': 41 var url = 'http://v.t.sina.com.cn/share/share.php?appkey=290510723&url='+product.url+'&title=' + encodeURIComponent("【@YOU】【"+product.address+"】 "+product.name) + '&pic=' + encodeURIComponent(product.image); 42 window.open(url); 43 break 44 45 //QQ 46 case 'tqq': 47 var url = 'http://v.t.qq.com/share/share.php?title='+encodeURIComponent("【@YOU】【"+product.address+"】"+product.name)+'&url='+product.url+'&appkey='+encodeURI("")+'&site='+product.url+'&pic='+product.image; 48 window.open( url,'转播到腾讯微博', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no' ); 49 break 50 51 //kaixin 52 case 'kaixin': 53 var url = 'http://www.kaixin001.com/repaste/share.php?rurl='+product.url+'&rcontent='+encodeURIComponent("【YOU】"+product.name + product.url) + '&rtitle='+encodeURIComponent(product.shortname); 54 window.open(url); 55 break 56 57 //renren 58 case 'renren': 59 var url = 'http://share.renren.com/share/buttonshare.do?link='+product.url+'&title='+encodeURIComponent("【YOU】"+product.name); 60 window.open(url); 61 break 62 63 //douban 64 case 'douban': 65 var url = 'http://www.douban.com/recommend/?url='+product.url+'&title=' + encodeURIComponent("【YOU】"+product.name); 66 window.open(url); 67 break 68 69 //163 70 case 't163': 71 var url = 'link=http://t.58.com/&source='+ encodeURIComponent('YOU')+ '&info='+ encodeURIComponent("【YOU】【"+product.address+"】 "+product.name) + ' ' + encodeURIComponent(product.url); 72 window.open('http://t.163.com/article/user/checkLogin.do?'+url+'&'+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'); 73 break 74 } 75 } 76 } 77 } 78 </script> 79 </body> 80 </html>
分享到新浪微博,腾讯微博,网易微博,开心,人人,豆瓣相关推荐
- js分享代码(新浪微博,腾讯微博,QQ空间,QQ好友)
js分享代码(新浪微博,腾讯微博,QQ空间,QQ好友) 代码如下: <!DOCTYPE html> <html lang="en"> <head> ...
- 音乐市场只剩腾讯、网易和阿里?豆瓣音乐拆分来搅局
数字音乐市场并没有因为巨头格局的形成而固化,反而是暗流涌动.数字音乐巨头Spotify于4月3日晚在纽交所直接上市,腾讯音乐娱乐集团数字专辑屡破纪录,网易云音乐在下架周杰伦的同时在成都与亚朵合开一家酒 ...
- 大佬分享开发经验!腾讯、网易必问的20道题Android面试题,震撼来袭免费下载!
导语 又到了面试季,自己也不得不参与到这场战役中来,其实是从去年底就开始看,Android的好机会确实不太多,但也还好,3年+的android开发经历还是有一些面试机会的,不过确实不像几年前门槛那么低 ...
- 一键分享到新浪微博、腾讯微博、搜狐微博、人人网、开心网、百度收藏等js代码大全...
下面给大家一些分享的js代码,只要把代码插入自己的网页中稍微修改一下图片路径就可以用了,好了,废话少说,上代码: document.writeln("<b>喜欢本文,那就分享到 ...
- 安卓 android一键分享 新浪微博 腾讯微博,qq空间,qq,人人网
安卓 android一键分享 新浪微博 腾讯微博,qq空间,qq,人人网 附源码: http://download.csdn.net/detail/zjgwxh/8678809
- php qq分享内容到指定qq,分享内容到新浪微博|腾讯微博|qq空间
分享内容到新浪微博|腾讯微博|qq空间 (2013-10-29 14:05:30) 标签: 内容 分享 微博 空间 分类: php function forward_sinaweibo(title) ...
- 分享功能(分享到新浪微博、腾讯微博、人人网、QQ空间。。。)
加网 http://www.jiathis.com/ 提供分享到微博.QQ.人人等代码...通过访客不断的分享行为,提升网站的优质外链.增加社会化流量.带来更多的用户! 分享到微博: 代码 将以下代码 ...
- android分享到新浪微博,认证+发送微博,神马'40113token_rejected! Oauth Token不合法'错误,都TMD都是浮云,终于一切搞定!
分享到新浪微博,折腾了大半个月,现在终于弄出来了,心里的那个爽呀,太痛快了,哈哈!! 废话少说,首先是认证, 1.进入新浪微博提供的开放平台http://open.weibo.com/ 注册新浪账号. ...
- 网易微博宣布将用户迁移至轻博客Lofter
再见微博的黄金时代!网易微博宣布将用户迁移至轻博客Lofter http://www.nbd.com.cn 2014-11-05 17:24 来源: 36氪 今天,网易微博在页面顶端发出公告,宣布网易 ...
最新文章
- 2021年黑龙江省智能车邀请赛
- asic面试题目 英伟达_英伟达一面总结
- zoj 3762(求三角形的最大高)
- linux运维适合女生么,女生真的不适合做IT行业吗?Linux运维适合女生学习吗?
- Python3 使用requests请求,解码时出错:'utf8' codec can't decode byte 0x8b in position 1: invalid start byte...
- 美国太空部队加入美国情报系统,以确保太空的安全
- WebRTC之RFC协议下载(八)
- 计算机图形学算法详解,计算机图形学裁剪算法详解
- FR跨SHEET条件汇总
- shell——按指定列排序
- 色彩构成(Interaction of Colour)
- 为知笔记 | 快速收集有价值的网页,微博,邮件!
- 5万款Lr顶级调色预设合集,精心整理,分类清晰,摄影师调色师必备素材,够用一辈子
- HANA 存储过程 YTD
- 计算机图形学直线算法程序,计算机图形学直线生成算法实现.doc
- 什么是IaaS、PaaS和SaaS
- Spark的坑--Spark新手必看--Python Spark必读,耗费了我近三周的时间
- nuc6i7kyk+linux+驱动,Intel 2016年最新版迷你PC!NUC Kit NUC6i7KYK 骷髅峡谷迷你PC!
- strsep 是将字符串截断
- Ubuntu下Firefox无法打开localhost:5560/isqlplus解决办法