目前pc微信分享,是通过扫描二维码进行分享

    var _title,_source,_sourceUrl,_pic,_showcount,_desc,_summary,_site,_width = 600,_height = 600,_top = (screen.height-_height)/2,_left = (screen.width-_width)/2,_url = '',_pic = '';//分享到新浪微博function shareToSinaWB(event){event.preventDefault();var _shareUrl = 'http://v.t.sina.com.cn/share/share.php?&appkey=895033136';     //真实的appkey,必选参数_shareUrl += '&url='+ encodeURIComponent(_url||document.location.href);     //参数url设置分享的内容链接|默认当前页location,可选参数_shareUrl += '&title=' + encodeURIComponent(_title||document.title);    //参数title设置分享的标题|默认当前页标题,可选参数_shareUrl += '&source=' + encodeURIComponent(_source||'');_shareUrl += '&sourceUrl=' + encodeURIComponent(_sourceUrl||'');_shareUrl += '&content=' + 'utf-8';   //参数content设置页面编码gb2312|utf-8,可选参数_shareUrl += '&pic=' + encodeURIComponent(_pic||'');  //参数pic设置图片链接|默认为空,可选参数window.open(_shareUrl,'_blank','width='+_width+',height='+_height+',top='+_top+',left='+_left+',toolbar=no,menubar=no,scrollbars=no, resizable=1,location=no,status=0');}//分享到QQ空间function shareToQzone(event){event.preventDefault();var _shareUrl = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?';_shareUrl += 'url=' + encodeURIComponent(_url||document.location);   //参数url设置分享的内容链接|默认当前页location_shareUrl += '&showcount=' + _showcount||0;      //参数showcount是否显示分享总数,显示:'1',不显示:'0',默认不显示_shareUrl += '&desc=' + encodeURIComponent(_desc||'分享的描述');    //参数desc设置分享的描述,可选参数_shareUrl += '&summary=' + encodeURIComponent(_summary||'分享摘要');    //参数summary设置分享摘要,可选参数_shareUrl += '&title=' + encodeURIComponent(_title||document.title);    //参数title设置分享标题,可选参数_shareUrl += '&site=' + encodeURIComponent(_site||'');   //参数site设置分享来源,可选参数_shareUrl += '&pics=' + encodeURIComponent(_pic||'');   //参数pics设置分享图片的路径,多张图片以"|"隔开,可选参数window.open(_shareUrl,'_blank','width='+_width+',height='+_height+',top='+_top+',left='+_left+',toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=0');}//分享到百度贴吧function shareToTieba(event){event.preventDefault();var _shareUrl = 'http://tieba.baidu.com/f/commit/share/openShareApi?';_shareUrl += 'title=' + encodeURIComponent(_title||document.title);  //分享的标题_shareUrl += '&url=' + encodeURIComponent(_url||document.location);  //分享的链接_shareUrl += '&pic=' + encodeURIComponent(_pic||'');    //分享的图片window.open(_shareUrl,'_blank','width='+_width+',height='+_height+',left='+_left+',top='+_top+',toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=0');}//分享到豆瓣function shareToDouban(event){event.preventDefault();var _shareUrl = 'http://shuo.douban.com/!service/share?';_shareUrl += 'href=' + encodeURIComponent(_url||location.href);    //分享的链接_shareUrl += '&name=' + encodeURIComponent(_title||document.title);    //分享的标题_shareUrl += '&image=' + encodeURIComponent(_pic||'');    //分享的图片window.open(_shareUrl,'_blank','width='+_width+',height='+_height+',left='+_left+',top='+_top+',toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=0');}//分享到腾讯微博function shareToQQwb(event){event.preventDefault();var _shareUrl = 'http://v.t.qq.com/share/share.php?';_shareUrl += 'title=' + encodeURIComponent(_title||document.title);    //分享的标题_shareUrl += '&url=' + encodeURIComponent(_url||location.href);    //分享的链接_shareUrl += '&appkey=5bd32d6f1dff4725ba40338b233ff155';    //在腾迅微博平台创建应用获取微博AppKey_shareUrl += '&site=' + encodeURIComponent(_site||'');   //分享来源_shareUrl += '&pic=' + encodeURIComponent(_pic||'');    //分享的图片,如果是多张图片,则定义var _pic='图片url1|图片url2|图片url3....'window.open(_shareUrl,'_blank','width='+_width+',height='+_height+',left='+_left+',top='+_top+',toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=0');}//分享到开心网function shareToKaixin(event){event.preventDefault();var _shareUrl = 'http://www.kaixin001.com/rest/records.php?';_shareUrl += 'url=' + encodeURIComponent(_url||location.href);    //分享的链接_shareUrl += '&content=' + encodeURIComponent('分享的文字');    //需要分享的文字,当文字为空时,自动抓取分享网址的title_shareUrl += '&pic=' + encodeURIComponent(_pic||'');     //分享的图片,多个使用半角逗号分隔_shareUrl += '&showcount=0';    //是否显示分享数,显示:'1',不显示:'0'_shareUrl += '&style=11';      //显示的样式,必选参数_shareUrl += '&aid=' + encodeURIComponent(_site||'');    //显示分享来源window.open(_shareUrl,'_blank','width='+_width+',height='+_height+',left='+_left+',top='+_top+',toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=0');}function shareToKaixin2(event){event.preventDefault();var _shareUrl = 'http://www.kaixin001.com/repaste/share.php?';_shareUrl += 'rtitle=' + encodeURIComponent(_title||document.title);   //分享的标题window.open(_shareUrl,'_blank','width='+_width+',height='+_height+',left='+_left+',top='+_top+',toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=0');}//分享到facebookfunction shareToFacebook(event){event.preventDefault();var _shareUrl = 'http://www.facebook.com/sharer/sharer.php?';_shareUrl += 'u=' + encodeURIComponent(_url||location.href);    //分享的链接_shareUrl += '&t=' + encodeURIComponent(_title||document.title);    //分享的标题window.open(_shareUrl,'_blank','width='+_width+',height='+_height+',left='+_left+',top='+_top+',toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=0');}//分享到facebookfunction shareToFacebook(event){event.preventDefault();var _shareUrl = 'http://www.facebook.com/sharer/sharer.php?';_shareUrl += 'u=' + encodeURIComponent(_url||location.href);    //分享的链接_shareUrl += '&t=' + encodeURIComponent(_title||document.title);    //分享的标题window.open(_shareUrl,'_blank','width='+_width+',height='+_height+',left='+_left+',top='+_top+',toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=0');}//分享到Twitterfunction shareToTwitter(event){event.preventDefault();var _shareUrl = 'http://twitter.com/intent/tweet?';_shareUrl += 'url=' + encodeURIComponent(_url||location.href);    //分享的链接_shareUrl += '&text=' + encodeURIComponent(_title||document.title);    //分享的标题window.open(_shareUrl,'_blank','width='+_width+',height='+_height+',left='+_left+',top='+_top+',toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=0');}

http://sabrinatian.github.io/webpage-sharing/share.html

转载于:https://www.cnblogs.com/duanzb/p/9275036.html

js分享微信 ,微博 ,qq空间相关推荐

  1. 《社交红利》读书总结--如何从微信微博QQ空间等社交网络带走海量用户、流量与收入...

    <社交红利--如何从微信微博QQ空间等社交网络带走海量用户.流量与收入>--徐志斌 著 <社交红利>这本书2013年9月才上市,卖的非常火. 我最初是在公司内部的期刊上,看到有 ...

  2. 《社交红利》读书总结--如何从微信微博QQ空间等社交网络带走海量用户、流量与收入

    <社交红利--如何从微信微博QQ空间等社交网络带走海量用户.流量与收入>--徐志斌 著 <社交红利>这本书2013年9月才上市,卖的非常火. 我最初是在公司内部的期刊上,看到有 ...

  3. js分享代码(新浪微博,腾讯微博,QQ空间,QQ好友)

    js分享代码(新浪微博,腾讯微博,QQ空间,QQ好友) 代码如下: <!DOCTYPE html> <html lang="en"> <head> ...

  4. 【网页分享到微博、微信、qq空间、qq】

    网页分享到微博.微信.qq空间.qq 参考文章 实现功能 获取当前网址 document.location.href 1.微博分享 2.微信分享 3.qq空间分享 4.qq分享 参考文章 参考文章 实 ...

  5. 快速接入 微信微博QQ钉钉 原生登录分享

    使用 微博.QQ.微信.钉钉 原生 SDK 接入,提供这些平台的登录.分享功能支持.针对业务逻辑对各个平台的接口进行封装,对外提供一致的表现,在减轻接入压力的同时,又能获得原生 SDK 最大的灵活性. ...

  6. 「开源」快速接入微信微博QQ钉钉登录分享

    使用 微博.QQ.微信.钉钉 原生 SDK 接入,提供这些平台的登录.分享功能支持.针对业务逻辑对各个平台的接口进行封装,对外提供一致的表现,在减轻接入压力的同时,又能获得原生 SDK 最大的灵活性. ...

  7. php qq分享内容到指定qq,分享内容到新浪微博|腾讯微博|qq空间

    分享内容到新浪微博|腾讯微博|qq空间 (2013-10-29 14:05:30) 标签: 内容 分享 微博 空间 分类: php function forward_sinaweibo(title) ...

  8. 封装微信微博QQ分享lib快速使用

    上次封装了分享图片资源的处理趁着有空 把分享功能进行了整合封装 ShareLib 集成微信微博QQ分享功能 1.接入工程 在主工程的build.gradle 中添加maven仓库地址 maven { ...

  9. html5仿qq空间,JS实现的仿QQ空间图片弹出效果代码

    本文实例讲述了JS实现的仿QQ空间图片弹出效果代码.分享给大家供大家参考,具体如下: function imageShow(which_click) { var image_path = which_ ...

  10. android qq空间 sdk,Android中使用腾讯的SDK完成分享图文到qq空间

    1.首先在腾讯开放平台中注册APP_ID,下载SDK并导入到应用程序 2.开始分享图文到qq空间 /** * 分享歌曲到qzone */ private void share2qzone() { fi ...

最新文章

  1. php 读取stdclass,json - 在php中读取stdclass的问题?
  2. 将csv文件导入到数据库中
  3. linux下编辑某个文件,linux下修改以某个字母开头的文件后戳
  4. Mongodb带验证的主从复制架构
  5. 洛谷P3879 [TJOI2010] 阅读理解 哈希Hash解法
  6. mysql类型float_Mysql数据类型---FLOAT
  7. mybatis-plus自定义sql分页
  8. [译] 人人都是设计师。我们可以的
  9. 盖洛普Q12在团队中的应用
  10. php把 图片上传到 图片服务器
  11. 速读原著-TCP/IP(IP首部)
  12. Word2Vec的安装与使用
  13. 《Python程序设计(第3版)》[美] 约翰·策勒(John Zelle) 第 9 章 答案
  14. 基于HTML旅游酒店主题网页项目的设计与实现——度假酒店预订网站(5页面)HTML+CSS+JavaScript...
  15. php srt,常见字幕文件格式(lrc、srt、ass)的区别以及互相转换的方法
  16. 【Beta】Scrum Meeting 4
  17. [附源码]java毕业设计网上点餐系统
  18. window系统未能启动服务器,Windows系统下Apache服务器无法启动的问题解决
  19. 全媒体运营师胡耀文教你:教你从0到1,搭建直播电商的直播间模块
  20. 美年旅游_自由行_新增自由行

热门文章

  1. 属于微型计算机主要性能指示,2014年兰大入学测试题--计算机基础
  2. java 数组排序_用Java对数组排序
  3. php目录遍历漏洞复现,nginx解析漏洞,配置不当,目录遍历漏洞环境搭建、漏洞复现...
  4. pcap封包修改服务器数据,tcprewrite批量修改pcap数据报文
  5. nginx一个端口配置多域名服务
  6. STM8 ADC转换模式-------带缓存的连续模式
  7. Spring中事务使用
  8. 【数据分析】你一定要掌握的Python七种数据清洗方法
  9. DCMTK3.6.0 安装失败的说明
  10. from __future__ import的用法