纯js实现网页端QQ分享给好友
var _title = '百度一下',//分享的标题(可选)
_desc = '',//分享的描述(可选)
_url = http://www.baidu.com',//分享的链接
_pics = 'http://www.newsucai.cn/static/home/images/jpg/__header.jpg',//分享的图片(可选)
_summary = '错过这个村就没这个店了!';//分享摘要(可选)
_flash = '';//视频地址(可选)
_site = http://www.baidu.com';//分享来源(可选)
function share() {
event.preventDefault();
var _shareUrl = 'https://connect.qq.com/widget/shareqq/index.html?';
_shareUrl += 'url=' + encodeURIComponent(_url||location.href);
_shareUrl += '&title=' + encodeURIComponent(_title||document.title);
_shareUrl += '&pics=' + encodeURIComponent(_pics||'');
_shareUrl += '&desc=' + encodeURIComponent(_desc||'');
_shareUrl += '&summary=' + encodeURIComponent(_summary||'');
window.open(_shareUrl,'_blank');
}