var share = {
"tit": '您的朋友分享了文章',
"desc": '分享来自百度文库,包含。。。',
"pic": 'https://' + window.location.host + '/web/images/shareLogo.png',
"localhostAdd": 'https://' + window.location.host,
//"pic":'http://www.elitez.cn/c/images/head.jpg',
"url": ''
} //分享至微信
$('body').on('mouseover', '.wchat', function (event) {
var urlText = $(this).siblings('.urlText').text();
var code = $('.share').text();
//var name = $('#hidden').val();
var questionId = $(this).siblings('.questionId').text();
if ($(this).find(".myQuCode canvas").length == 0) {
$(this).find(".myQuCode").qrcode({
//render: "table", //table方式
width: 110, //宽度
height: 110, //高度
//text: //任意内容
text: window.location.protocol + '//' + window.location.host + "/public/mobile/xinzhiMobile.jsp?questionId=" + questionId
});
}
console.log(window.location.protocol + '//' + window.location.host + "/public/mobile/xinzhiMobile.jsp?questionId=" + questionId)
}) //分享至微博
$('body').on('click', '.share_sina', function (event) {
var urlText = $(this).parent().siblings('.lastLi').find('.urlText').text();
var targetUrl = window.location.protocol + '//' + window.location.host + '/' + urlText;
var code = $('.share').text();
//var name = $('#hidden').val();
var url = "http://v.t.sina.com.cn/share/share.php",
_url = targetUrl,
_title = share.desc,
_appkey = '',
_ralateUid = '',
c = '', pic = share.pic;
c = url + "?url=" + encodeURIComponent(_url) + "&appkey=" + _appkey + "&title=" + _title + "&pic=" + pic + "&ralateUid=" + _ralateUid + "&language=";
window.open(c, "shareQQ", "height=480,width=608,top=100,left=200,toolbar=no,menubar=no,resizable=yes,location=yes,status=no");
}); //分享至QQ
$('body').on('click', '.share_qq', function (event) {
var urlText = $(this).parent().siblings('.lastLi').find('.urlText').text();
var targetUrl = window.location.protocol + '//' + window.location.host + '/' + urlText;
//var name = $('#hidden').val();
var a = "http://connect.qq.com/widget/shareqq/index.html",//"http://connect.qq.com/widget/shareqq/index.html",
d = targetUrl,
m = share.tit,
pic = share.pic,
pl = '加点评论吧...',
titsummary = share.desc,
b = "",
x = window.screen.width,
y = window.screen.height;
h = "", k = ""; //g = l.join("||")||"";
k = a + "?url=" + encodeURIComponent(d) + "&showcount=0&desc=" + encodeURIComponent(pl) + "&summary=" + encodeURIComponent(titsummary) + "&title=" + encodeURIComponent(m) + "&pics=" + pic + "&style=203&width=19&height=22";
window.open(k, "", "height = 680, width = 960, top = " + (y - 680) / 2 + ", left = " + (x - 960) / 2 + ", toolbar = no, menubar = no, resizable = yes, location = yes,status = no");
}); //复制
var clipboard = new Clipboard('.btnShareCopy');
clipboard.on('success', function(e) {
alerter("复制成功")
//console.log(e);
});

分享至微信、QQ、微博、复制链接的更多相关文章

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

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

  2. 网页分享到微信、微博、QQ空间、百度贴吧等

    1.首先说明的是,pc端微信分享只能通过二维码来分享. 2.下面是js代码. //分享到新浪微博 function shareToSinaWB(event){ event.preventDefault ...

  3. 分享到微信、微博、QQ空间、QQ微博

    一:分享到微信 //分享到微信$("#weixin").bind("click", function () {    var p = {        url: ...

  4. 如何在自己的代码中实现分享视频文件或者是图片文件到微信 QQ微博 新浪微博等!!!

    首先在文档第一句我先自嘲下 , 我是大傻逼, 弄了两天微信是视频分享,一直被说为啥跟系统的相册分享的不一样,尼玛!!! 这里来说正文,我这里不像多少太多,大家都是程序猿,具体的阔以看代码. 搞代码之前 ...

  5. javascript社交平台分享-新浪微博、QQ微博、QQ好友、QQ空间、人人网

    整理的五个社交平台的分享 <!doctype html> <html lang="en"> <head> <meta charset=&q ...

  6. unity3d应用内分享(微信、微博等)的实现

    问题:如何在unity3d的游戏中实现分享功能,如图 思路: 1.分享功能的实现方式有多种,较方便快捷的一种是直接调用android的API来调出系统的分享界面 2.unity3d里面调用androi ...

  7. 安卓,通过本地应用分享到微信、facebook等

    别的不说了,直接上代码. 支持分享到微信.微博.facebook.twitter package com.example.shareSample; import java.util.List; imp ...

  8. h5怎么做分享到QQ 、朋友圈、微信 、微博等功能

    微信已经成为我们日常聊天联系基本的必备工具,所以小菜我首先介绍一下如何调用微信的分享功能.其实除了可以在微信上分享到朋友圈和发送给好友,微信的分享接口还提供了分享到QQ和分享到腾讯微博等,就是在页面的 ...

  9. apiCloud 三方分享,微信好友分享,微信朋友圈分享,QQ分享,微博分享

    首先查看我的这篇有关三方登录的博客,地址是http://www.cnblogs.com/gqx-html/p/8303567.html,配置完三方数据后可以从上一篇文章中的链接跳转到各个登录查看api ...

随机推荐

  1. 【转载】webstorm-前端javascript开发神器中文教程和技巧分享

    webstorm是一款前端javascript开发编辑的神器,此文介绍webstorm的中文教程和技巧分享. webstorm8.0.3中文汉化版下载:百度网盘下载:http://pan.baidu. ...

  2. 1112 Stucked Keyboard (20 分)

    1112 Stucked Keyboard (20 分) On a broken keyboard, some of the keys are always stucked. So when you ...

  3. php中的释放语句unset和释放函数mysql_free_result()

    首先要强调的一点是unset在php中已经不再是一个函数了,既然不是函数,那么就没有了返回值,所以用的时候不能够用unset的返回值来做判断. 其次,在函数中,unset只能销毁局部变量,并不能销毁全 ...

  4. ORM( ORM查询13种方法3. 单表的双下划线的使用 4. 外键的方法 5. 多对多的方法 ,聚合,分组,F查询,Q查询,事务 )

    必知必会13条 <1> all(): 查询所有结果 <2> get(**kwargs): 返回与所给筛选条件相匹配的对象,返回结果有且只有一个,如果符合筛选条件的对象超过一个或 ...

  5. DOM事件机制(事件捕获和事件冒泡和事件委托)

    内容: 1.事件复习 2.事件冒泡与事件捕获 3.事件委托 1.事件复习 (1)事件 事件是用来处理响应的一个机制,这个响应可以来自于用户(点击, 鼠标移动, 滚动), 也可以来自于浏览器 下面的链接 ...

  6. 2018-2019-2 《网络对抗技术》Exp1 PC平台逆向破解 Week3 20165233

    Exp1 PC平台逆向破解 实验内容 一.基础知识点 NOP, JNE, JE, JMP, CMP汇编指令的机器码 NOP指令即"空指令",执行到NOP指令时,CPU什么也不做,机 ...

  7. tornado-通过判断后台数据限制登陆--简单的

    import tornado.ioloop import tornado.web import tornado.httpserver # 非阻塞 import tornado.options # 提供 ...

  8. 下载Chrome独立版(alternate/offline Installer)的地方

    因为Great fire wall,Chrome无法更新,下载独立版(alternate/offline Installer)的地方 很多朋友可以用proxy firefox访问google,却无法让 ...

  9. 2. select下拉框获取选中的值

    1.获取select选中的value值: $("#select1ID").find("option:selected").val();  --select1ID ...

  10. 笔记本 F1 键盘

    笔记本 F1 键盘与传统不符. 在控制面板,键盘设置,选择ok.