如何给自己的网站添上"分享到QQ空间"的功能?
您可以选择以下文字或图标样式,复制代码到您的网站。

把以下代码放到你网站文章页面的php文件里面就可以,自己注意好放入的位置。

样式一:

文字:分享到QQ空间

<script type="text/javascript">document.write(['<a href="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=',encodeURIComponent(location.href),'&title=',encodeURIComponent(document.title),'" target="_blank" title="分享到QQ空间">分享到QQ空间<\/a>'].join(''));</script>

样式二:

小图标:分享到QQ空间

<script type="text/javascript">document.write(['<a href="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=',encodeURIComponent(location.href),'&title=',encodeURIComponent(document.title),'" target="_blank" title="分享到QQ空间"><i class="fa fa-share-alt"></i>分享到QQ空间<\/a>'].join(''));</script>

样式三:

图片:分享到QQ空间

<script type="text/javascript">document.write(['<a href="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=',encodeURIComponent(location.href),'&title=',encodeURIComponent(document.title),'" target="_blank" title="分享到QQ空间"><img src="http://qzonestyle.gtimg.cn/ac/qzone_v5/app/app_share/qz_logo.png" alt="分享到QQ空间" /><\/a>'].join(''));</script>