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

    var _title,_source,_sourceUrl,_pic,_showcount,_desc,_summary,_site,
_width = ,
_height = ,
_top = (screen.height-_height)/,
_left = (screen.width-_width)/,
_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||; //参数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');
} //分享到facebook
function 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');
}
//分享到facebook
function 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');
} //分享到Twitter
function 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

js分享微信 ,微博 ,qq空间的更多相关文章

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

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

  2. 分享微博,qq空间,微信

    <div class="share_class" ><div class="bdsharebuttonbox">    <a hr ...

  3. 网站文章分享到微博,微信、qq空间--举例用织梦

    有对应接口的,传递参数过去就行了,注意下面的{..},需要替换为你的内容,看参数名称你应该知道是什么东东 新浪地址接口http://service.weibo.com/share/share.php? ...

  4. 报bug mui分享微信 ,qq 分享失败

    1. iOS分享链接到微信,分享成功,但是分享的只有title,其他参数都没有 原因是mui分享进行了更新,msg新增了 msg.type 这个配置参数 qq : msg.type='text' 微信 ...

  5. 自己动手写js分享插件 [支持https] (可以分享QQ空间,微信,新浪微博。。。)

    由于百度分享,jiathis 等分享插件在https下均会报错,就萌生了自己动手写一个分享插件的念头,其实实现起来一点都不难,以下代码都已在https网站运行通过,特附上以下代码:还请各位看官不吝赐教 ...

  6. 自己动手写js分享插件 [支持https] (QQ空间,微信,新浪微博。。。)

    转载:https://blog.csdn.net/libin_1/article/details/52424340 废话不多说,传送门:http://download.csdn.net/detail/ ...

  7. Android 调用系统分享文字、图片、文件,可直达微信、朋友圈、QQ、QQ空间、微博

    原文:Android 调用系统分享文字.图片.文件,可直达微信.朋友圈.QQ.QQ空间.微博 兼容SDK 18以上的系统,直接调用系统分享功能,分享文本.图片.文件到第三方APP,如:微信.QQ.微博 ...

  8. js分享功能(微信,QQ,微博,空间,豆瓣等)

    日常编程中,我们可能会碰到项目中的分享功能,各大平台都有分享接口和文档说明,当然也有一些一键分享插件,例如:sosh,iShare.js等等 但有些同学不想引用插件,那么我整理了一些常用的分享至平台功 ...

  9. js 分享QQ、QQ空间、微信、微博

    //分享QQ好友 function qq(title,url,pic) { var p = { url: 'http://test.qicheyitiao.com',/*获取URL,可加上来自分享到Q ...

随机推荐

  1. 文艺平衡树 lg3391(splay维护区间入门)

    splay是支持区间操作的,先做这道题入个门 大多数操作都和普通splay一样,就不多解释了,只解释一下不大一样的操作 #include<bits/stdc++.h> using name ...

  2. python os 模块详解

    os.sep:取代操作系统特定的路径分隔符 os.name:指示你正在使用的工作平台.比如对于Windows,它是'nt',而对于Linux/Unix用户,它是'posix'. os.getcwd:得 ...

  3. jvm 结构分析

    jvm区域总体分两类,heap区和非heap区.heap区又分: Eden Space(伊甸园).Survivor Space(幸存者区).Tenured Gen(老年代-养老区). 非heap区又分 ...

  4. Git 添加远程github仓库的时候提示错误:fatal: remote origin already exists.

    1.先删除远程 Git 仓库 $ git remote rm origin 2.再添加远程 Git 仓库 $ git remote add origin git@github.com:wsydxian ...

  5. VMare安装及虚拟机的安装

    VMware安装 1.下载安装包安装 2.安装虚拟机 ![](ht p 接下来的开启虚拟机按照默认的配置 install or upgrade an existing system skip(选择跳过 ...

  6. python多进程编程学习笔记

    摘自[https://www.cnblogs.com/chenhuabin/p/10070996.html] by 奥辰 赞

  7. 题解 P5530 [BalticOI 2002]双调路径

    P5530 [BalticOI 2002]双调路径 输入样例: 4 5 1 4 2 1 2 1 3 4 3 1 2 3 1 2 3 1 1 4 2 4 2 4 样例如下图 样例说明: 从1到4有4条路 ...

  8. STL顺序容器用法自我总结

    顺序容器类型:vector.deque.list.forward_list.string.array. queue(单向队列)底层也是用deque(双端队列)实现的 a.swap(b); swap(a ...

  9. js实现图片无缝轮播

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  10. opencv:全局阈值

    图像的二值化分割,最重要的就是计算阈值 阈值的计算方法很多,基本分为两类,全局阈值与自适应阈值 OTSU.Triangle #include <opencv2/opencv.hpp> #i ...