分享至微信、QQ、微博、复制链接
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、微博、复制链接的更多相关文章
- js分享功能(微信,QQ,微博,空间,豆瓣等)
日常编程中,我们可能会碰到项目中的分享功能,各大平台都有分享接口和文档说明,当然也有一些一键分享插件,例如:sosh,iShare.js等等 但有些同学不想引用插件,那么我整理了一些常用的分享至平台功 ...
- 网页分享到微信、微博、QQ空间、百度贴吧等
1.首先说明的是,pc端微信分享只能通过二维码来分享. 2.下面是js代码. //分享到新浪微博 function shareToSinaWB(event){ event.preventDefault ...
- 分享到微信、微博、QQ空间、QQ微博
一:分享到微信 //分享到微信$("#weixin").bind("click", function () { var p = { url: ...
- 如何在自己的代码中实现分享视频文件或者是图片文件到微信 QQ微博 新浪微博等!!!
首先在文档第一句我先自嘲下 , 我是大傻逼, 弄了两天微信是视频分享,一直被说为啥跟系统的相册分享的不一样,尼玛!!! 这里来说正文,我这里不像多少太多,大家都是程序猿,具体的阔以看代码. 搞代码之前 ...
- javascript社交平台分享-新浪微博、QQ微博、QQ好友、QQ空间、人人网
整理的五个社交平台的分享 <!doctype html> <html lang="en"> <head> <meta charset=&q ...
- unity3d应用内分享(微信、微博等)的实现
问题:如何在unity3d的游戏中实现分享功能,如图 思路: 1.分享功能的实现方式有多种,较方便快捷的一种是直接调用android的API来调出系统的分享界面 2.unity3d里面调用androi ...
- 安卓,通过本地应用分享到微信、facebook等
别的不说了,直接上代码. 支持分享到微信.微博.facebook.twitter package com.example.shareSample; import java.util.List; imp ...
- h5怎么做分享到QQ 、朋友圈、微信 、微博等功能
微信已经成为我们日常聊天联系基本的必备工具,所以小菜我首先介绍一下如何调用微信的分享功能.其实除了可以在微信上分享到朋友圈和发送给好友,微信的分享接口还提供了分享到QQ和分享到腾讯微博等,就是在页面的 ...
- apiCloud 三方分享,微信好友分享,微信朋友圈分享,QQ分享,微博分享
首先查看我的这篇有关三方登录的博客,地址是http://www.cnblogs.com/gqx-html/p/8303567.html,配置完三方数据后可以从上一篇文章中的链接跳转到各个登录查看api ...
随机推荐
- HA 高可用mysql集群
注意问题: 1.保持mysql用户和组的ID号是一致的: 2.filesystem 共享存储必须要有写入权限: 3.删除资源必须先删除约束,在删除资源: 1.安装数据库,这里使用maridb数据库: ...
- Hibernate 一对多/多对多
一对多关联(多对一): 一对多关联映射: 在多的一端添加一个外键指向一的一端,它维护的关系是一指向多 多对一关联映射: 咋多的一端加入一个外键指向一的一端,它维护的关系是多指向一 在配置文件中添加: ...
- 提高 web 应用性能之 CSS 性能调优
简介 Web 开发中经常会遇到性能的问题,尤其是 Web 2.0 的应用.CSS 代码是控制页面显示样式与效果的最直接“工具”,但是在性能调优时他们通常被 Web 开发工程师所忽略,而事实上不规范的 ...
- uva-10305-水题-拓扑排序
输入n,m,n代表点数,m代表边数(i,j),排序时i在j前面,没出现的点随意排 #include <iostream> #include<stdio.h> #include& ...
- 温故而知新-mysql高级管理
温故而知新-mysql高级管理 1 mysql的一些授权信息都保存在授权表中 授权表是6个 db,user,host,tables_priv,columns_priv,procs_priv 这6个表 ...
- 2.Triangle (三角形)
1.等腰直角三角形: https://www.cnblogs.com/FlyingLiao/p/9869040.html 2.1任意三角形: <!DOCTYPE html> <htm ...
- win10 + Ubuntu 双系统,重装后的引导修复,时间调整和启动项调整
▶ 原先为 win10 + Ubuntu 双系统,使用 grub2 作引导,在重装了 win10 (大作死升到了1803)后系统重写了引导,启动项里找不到 Ubuntu,需要修复. ● 参考[http ...
- Win10交换Ctrl和大写键
打开注册表 [HKEY_LOCAL_MacHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] "Scancode Map" ...
- aspx后台代码写在前段
合并cs的代码 <%@ Page Language="C#" AutoEventWireup="true" Inherits="System.W ...
- 【独家】完美解决appium安装app时,需要手动确认安装的问题
appium初始化driver时,如果未安装该app会先进行安装,安装时,很多安卓手机都会弹框,需要手动确认安装. 如小米的机器, 这是个头疼的问题,之前在网上找遍了,只有通过adb去点相对坐标成功了 ...