首先說分享到QQ空間的通用代碼:
<a href="javascript:void(0);" onclick="window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+encodeURIComponent(document.location.href));return false;" title="分享到QQ空間"><img src="http://qzonestyle.gtimg.cn/ac/qzone_v5/app/app_share/btn_share.png" alt="分享到QQ空間" /></a>
分享至QQ好友社區通用代碼:
<a href="javascript:void(0);" onclick="window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?to=pengyou&url='+encodeURIComponent(document.location.href));return false;" title="分享到朋友社區"><img src="http://qzonestyle.gtimg.cn/ac/qzone_v5/app/qzshare/to-py.png" alt="分享到朋友社區" /></a>
轉播至騰訊微博通用代碼:
<a href="javascript:void(0)" onclick="postToWb();" class="tmblog"><img src="http://v.t.qq.com/share/images/s/b24.png"></a> <script type="text/javascript">
function postToWb(){
var _t = encodeURI(document.title);
var _url = encodeURI(document.location);
var _appkey = encodeURI("appkey");//你從騰訊獲得的appkey
var _pic = encodeURI('');//(列如:var _pic='圖片url1|圖片url2|圖片url3....)
var _site = '';//你的網站地址
var _u = 'http://v.t.qq.com/share/share.php?title='+_t+'&url='+_url+'&appkey='+_appkey+'&site='+_site+'&pic='+_pic;
window.open( _u,'轉播到騰訊微博', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no' );
}
</script>
分享至新浪微博通用代碼:
<a href="javascript:(function(){window.open('http://v.t.sina.com.cn/share/share.php?
title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(location.href)
+'&source=bookmark','_blank','width=450,height=400');})()" title="新浪微博分享"><img
src="http://www.cyseo.org/upload/sina.gif" alt="新浪微博分享" border="0"></a>