ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

qq,新浪分享

2019-09-09 17:54:03  阅读:200  来源: 互联网

标签:qq encodeURIComponent title share shareUrl 参数 新浪 分享


var _title,_source,_sourceUrl,_pic,_showcount,_desc,_summary,_site;

// 新浪微博分享
$('.xlwb-share').on('click',function(event){
event.preventDefault();
$('.panle-share').hide()
var _shareUrl = 'http://v.t.sina.com.cn/share/share.php?title="123"'; //真实的appkey,必选参数
_shareUrl += '&url='+ encodeURIComponent(_url||document.location); //参数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');
})

// QQ空间分享
$('.QQ-zong-share').on('click',function(event){
event.preventDefault();
$('.panle-share').hide()
var _shareUrl = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?';
_shareUrl += 'url=' + encodeURIComponent(_urls||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');
})

// QQ好友分享
$('.QQ-friend-share').on('click',function(event){
event.preventDefault();
$('.panle-share').hide()
var _shareUrl = 'https://connect.qq.com/widget/shareqq/iframe_index.html?';
_shareUrl += 'url=' + encodeURIComponent(_url||location.href); //分享的链接
_shareUrl += '&title=' + encodeURIComponent(_title||document.title); //分享的标题
_shareUrl += '&pics=' + encodeURIComponent(_pic); //参数pics设置分享图片的路径,多张图片以"|"隔开,可选参数
window.open(_shareUrl,'_blank');
})

标签:qq,encodeURIComponent,title,share,shareUrl,参数,新浪,分享
来源: https://www.cnblogs.com/iroading/p/11493107.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有