微博分享网页 简单
2017-05-27 11:07
169 查看
首先在官网上注册个appkey然后再进行下面的步骤就行了,下面的AppKey不可随意使用,否则后果自负;
function postToSina(title,pic,site) { var param = { url:site, type:'5', count:'', appkey:'4177348326', title:encodeURI(title+""), pic:pic, ralateUid:'', language:'zh_cn', rnd:new Date().valueOf() } var temp = []; var s = window.screen; for( var p in param ){ temp.push(p + '=' + encodeURIComponent( param[p] || '' ) ) } var url = "http://service.weibo.com/share/share.php?"+temp.join("&"); window.open(url,"_blank",['toolbar=0,status=0,resizable=1,width=600,height=500,left=',(s.width-440)/2,',top=',(s.height-430)/2].join('')) } function postToQQ(title,pic,site){ var p = { url:site, showcount:'0',/*鏄惁鏄剧ず鍒嗕韩鎬绘暟,鏄剧ず锛�'1'锛屼笉鏄剧ず锛�'0' */ desc:title+" ",/*榛樿鍒嗕韩鐞嗙敱(鍙€�) 鏉ヨ嚜www.iliangcang.com*/ summary:'',/*鍒嗕韩鎽樿(鍙€�)*/ title:'',/*鍒嗕韩鏍囬(鍙€�)*/ site:encodeURI('dasf'),/*鍒嗕韩鏉ユ簮 濡傦細鑵捐缃�(鍙€�)*/ pics:pic, /*鍒嗕韩鍥剧墖鐨勮矾寰�(鍙€�)*/ style:'203', width:98, height:22, otype:'share' }; var s = window.screen; var param = []; for(var i in p){ param.push(i + '=' + encodeURIComponent(p[i]||'')); } var url = "http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?"+param.join("&"); window.open(url,"_blank",['toolbar=0,status=0,resizable=1,width=600,height=500,left=',(s.width-440)/2,',top=',(s.height-430)/2].join('')); jQuery('#postToWin').remove();removeDivLayer(); } function postToDouban(title,pic,site) { console.log("aa"); var d=document, e=encodeURIComponent, s1=window.getSelection, s2=d.getSelection, s3=d.selection, s=s1?s1():s2?s2():s3?s3.createRange().text:'', sre = window.screen, r='http://www.douban.com/recommend/?url='+e(site)+'&title='+e(title+"")+'&sel='+e(s)+'&v=1', x=function(){ if(!window.open(r,'douban','toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=330,left='+(sre.width-440)/2+',top='+(sre.height-430)/2))location.href=r+'&r=1' }; if(/Firefox/.test(navigator.userAgent)){setTimeout(x,0)}else{x()} }
相关文章推荐
- 分享微博按钮的简单实现,
- 分享下载 23 款简单常用的web前端jquery网页特效
- 在网页中添加分享到微信、QQ、微博
- 网页分享到微信、微博、QQ等
- 网页分享到微信、微博、QQ等
- 蛙蛙推荐:网页分享网,微博报,Wap个人助理,云会话服务
- 网页分享到微信、微博、QQ等
- 网页中实现"分享至微博、QQ空间等"代码
- 通过JavaScript打开网页方式进行分享-转最简单易用的开心网、人人网、新浪微博、腾讯微博、QQ空间分享代码
- 网页分享到微信、微博、QQ等
- 分享简单而实用的网页菜单导航【提供源码】
- 一个简单的网页计算器-php网站建设代码段分享
- 最简单的分享到微博代码
- iOS开发009 iOS快速简单集成微信QQ微博分享
- 最简单的网页分享代码
- JSP网页简单计数器 代码片段分享
- PHP 简单网站右边的分享按钮 分享到空间、微博的代码
- javascript判断是手机还是电脑访问网页的简单实例分享
- 使用JSP制作一个超简单的网页计算器的实例分享
- 网页分享到微信、微博、QQ等