带有计数的紧凑 Facebook 分享按钮?
我正在尝试在我的网站上添加一个简单紧凑的 fshare
按钮。我发现的唯一代码是这个:
<div style="float:left;padding:4px;">
<a expr:share_url='data:post.url' name='fb_share' rel='nofollow' type='button_count'/>
<script type="text/javascript" src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"/>
</div>
应该渲染为
但它的渲染不正确。它似乎试图创建多个按钮并“崩溃”所有页面。它会破坏 HTML,更改整个 div 的背景等等...
这是为什么?这是正确的代码吗?
I am trying to add a simple compact fshare
button on my website. The only code I found was this one:
<div style="float:left;padding:4px;">
<a expr:share_url='data:post.url' name='fb_share' rel='nofollow' type='button_count'/>
<script type="text/javascript" src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"/>
</div>
Which should render as
But it is not redering correct. It seems it is trying to create multiple buttons and "crashes" all the page. It corrupts the HTML, change the background of a entire div and so on...
Why is that? Is this the correct code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Facebook 不再建议使用分享按钮,而是应该使用点赞按钮。以下是他们在网站上的说法:
通过“赞”按钮,您可以使用 javascript 或 iframe 添加它,这样您就可以看到哪一个最适合您。在此处了解有关“赞”按钮的更多信息。
Facebook is not recommending the use of the share button anymore, instead you should use the like button. Here is what they say on their website:
With the like button, you can add it using javascript OR iframe, so you can see which one works best for you. Read more about the like button here.
http://sharethis.com 提供了一个小部件,允许您包含各种社交媒体网站的按钮,包括 fb 共享按钮与计数。 (它有自己的样式和大小,因此您可能需要覆盖一些 CSS,使其看起来像标准 FB 共享。)http://blog.pixert.com/facebook-share-button/,但我无法让它显示计数。
http://sharethis.com provides a widget that allows you to include buttons for various social media sites, including the fb share button with count. (It has their own style and size so you may need to override some of the CSS to make it look like the standard FB share.) There is also a solution at http://blog.pixert.com/facebook-share-button/, but I have not been able to get it to display a count.
将您的代码更改
为
Change your code
to