//分享到新浪微博
function shareToWeibo(title,url,picurl){
var shareweibostring='http://v.t.sina.com.cn/share/share.php?title='+title+'&url='+url+'&pic='+picurl;
window.open(shareweibostring);
}
//分享到qq空间
function shareToQQzone(title,url,picurl,desc='test desc', summary='test summary'){
var shareqqzonestring='http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?title='+title+'&url='+url+'&pics='+picurl+'&desc='+desc+'&summary='+summary;
window.open(shareqqzonestring);
}
function share() {
shareToQQzone("test title", "http://www.baidu.com", "http://aladdin-vray.oss-cn-beijing.aliyuncs.com/Other/80de988c-ad11-449b-af48-b5341c957668.jpg");
}
share()
备注:
分享到weibo,url必须带协议http://,分享到qq空间url协议加不加都可以
分享到QQ空间title必填,desc和summary选填
分享到QQ空间的效果