微博分享的实现
来源:互联网 发布:吉他入门 知乎 编辑:程序博客网 时间:2024/05/17 21:42
腾讯微博:
<a id="tqq" class="menu" href="javascript:window.open('http://v.t.qq.com/share/share.php?url='+encodeURIComponent('[url]')+'&pic='+encodeURIComponent('')+'&title='+encodeURIComponent([content])),'_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes'); void 0">腾讯微博</a>
新浪微薄:
<a id="sina" class="menu" href="javascript:window.open('http://v.t.sina.com.cn/share/share.php?appkey=1961588658&url='+encodeURIComponent('[url]')+'&pic='+encodeURIComponent('')+'&title='+encodeURIComponent('[content]'),'_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes'); void 0">新浪微博</a>
QQ空间:
<a id="qq" class="menu" href="javascript:window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+encodeURIComponent('[url]')+'&title='+encodeURIComponent('[content]'),'_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes'); void 0">QQ空间</a>
页面示例:
<body>
<script type="text/javascript">
function showLayers(){
if(!document.getElementById("shareLayer")) return false;
if(!document.getElementById("l_box")) return false;
var layerId = document.getElementById("shareLayer");
var lBoxId = document.getElementById("l_box");
if(layerId.offsetWidth == 30){
layerId.style.width = "180px"
lBoxId.style.display = "block";
}else{
layerId.style.width = "30px"
lBoxId.style.display = "none";
}
}
/*title是标题,rLink链接,summary内容,site分享来源,pic分享图片路径*/
/*新浪微博*/
function shareTSina(title,rLink,site,pic){
window.open('http://service.weibo.com/share/share.php?title='+encodeURIComponent(title)+'&url='+encodeURIComponent(rLink)+'&appkey='+encodeURIComponent(site)+'&pic='+encodeURIComponent(pic),'_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes')
}
/*腾讯微博*/
function shareToWb(title,rLink,site,pic){
window.open('http://v.t.qq.com/share/share.php?url='+encodeURIComponent(rLink)+'&title='+encodeURI(title)+'&appkey='+encodeURI(site)+'&pic='+encodeURI(pic),'_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes')
}
/*人人*/
function shareRR(title,rLink,summary){
window.open('http://widget.renren.com/dialog/feed?title='+encodeURIComponent(title)+'&link='+encodeURIComponent(rLink)+'&description='+encodeURIComponent(summary),'_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes');
}
/*开心网*/
function shareKX(title,rLink,summary){
window.open('http://www.kaixin001.com/repaste/bshare.php?rtitle='+encodeURIComponent(title)+'&rurl='+encodeURIComponent(rLink)+'&rcontent='+encodeURIComponent(summary),'_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes' )
}
/*QQ空间*/
function shareQzone(title,rLink,summary,site,pic){
window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?title='+encodeURIComponent(title)+'&url='+encodeURIComponent(rLink)+'&summary='+encodeURIComponent(summary)+ '&site='+encodeURIComponent(site)+'&pics='+encodeURIComponent(pic),'_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes')
}
/*百度*/
function shareBaiDu(title,rLink){
window.open('http://apps.hi.baidu.com/share?title='+encodeURIComponent(title)+'&url='+encodeURIComponent(rLink),'_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes')
}
/*豆瓣*/
function shareDouBan(title,rLink){
window.open('http://www.douban.com/recommend?title='+encodeURIComponent(title)+'&url='+encodeURIComponent(rLink),'_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes')
}
</script>
<div id="shareLayer">
<div id="s_btn" onclick="showLayers()"></div>
<div id="l_box">
<a href="javascript:void(0)" onclick="shareTSina('测试标题','http://www.ps-css.com','转贴网站','图片地址')">新浪微博</a>
<a href="javascript:void(0)" onclick="shareQzone('测试标题','http://www.ps-css.com','测试内容','转贴网站','图片地址')">QQ空间</a>
<a href="javascript:void(0)" onclick="shareRR('测试标题','http://www.ps-css.com','woshineirong');">人人网</a>
<a href="javascript:void(0)" onclick="shareKX('测试标题','http://www.ps-css.com','测试内容')">开心网</a>
<a href="javascript:void(0)" onclick="shareToWb('测试标题','http://www.ps-css.com','转贴网站','图片地址');">腾讯微博</a>
<a href="javascript:void(0)" onclick="shareBaiDu('测试标题','http://www.ps-css.com');">百度</a>
<a href="javascript:void(0)" onclick="shareDouBan('测试标题','http://www.ps-css.com');">豆瓣</a>
</div>
</div>
</body>
</html>
- 微博分享的实现
- 微博分享的实现
- 新浪微博 分享 功能的实现
- Android 微博分享实现
- 微信分享功能的实现
- vue 微信分享的实现
- 微信分享的代码实现
- 分享的Intent实现
- 实现微信分享以及解决分享后的回调监听是否分享成功
- 百度分享--分享按钮的实现
- Android 实现微博分享功能
- Android新浪微博分享实现
- android 新浪微博分享功能实现
- Android实现微博分享及其注意事项
- android 新浪微博实现分享功能
- Android新浪微博分享实现
- 分享自己实现的队列
- android分享功能的实现
- flex调用webservices查询中国城市天气返回的是数组类型
- List 的 removeAll 方法的效率
- 求大神帮忙完善一个java小游戏,急急急!!!!
- Outlook 2010创建电子信纸
- 利用大数据,你将会购买更多的东西
- 微博分享的实现
- xcode4的环境变量,Build Settings参数,workspace及联编设置
- PHP中,如何创建文件下载
- C++ 的访问控制设计原理
- WebKit中CSS处理流程(三)
- GIS开发一些资料关键字fg好
- MYSQL添加新用户 MYSQL为用户创建数据库 MYSQL为新用户分配权限
- 表达式求解
- 黑马程序员_Java基础Day14_集合框架