在此页面上,我使用AddThis JavaScript库添加了按钮,使得页面可以分享到Facebook/Twitter。如果你点击Facebook按钮,它会显示以下预览,展示如何将内容发布到Facebook:
请注意,预览中显示的图像是网站上使用的AJAX加载器,即在进行AJAX请求时显示的图像。我不知道为什么选择这个作为发布的图片,是否可以让我指定使用哪张图片?
以下是我用来显示分享按钮的标记:
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" style="width: 135px;">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<g:javascript base="http://s7.addthis.com" src="/js/250/addthis_widget.js#pubid=xa-4fcaa48b0ffdb7b9" type="js" />