Facebook分享功能 [英] Facebook Share functionality

查看:107
本文介绍了Facebook分享功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经用非常基本的代码实现了Facebook共享功能.但是它不显示图像"和标题"以及链接".我想显示自定义标题和图像.我的代码如下:

Hi,

I have implemented facebook share functionality with very basic code. But it does not display Image and title along with Link. I want to display custom title and images. My code is as below:

<a name="fb_share" type="button" href="http://www.facebook.com/sharer.php">Share</a>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
<meta name="title" content="This is the Title" />
<meta name="description" content="This is a short summary of the page." />
<link rel="image_src" href="http://www.murrayhilltech.com/images/LogoColorNoText.jpg" />


请帮帮我.

谢谢


Please help me.

Thanks

推荐答案



Facebook不再积极支持共享"按钮.它应该仍然可以工作,但是不能在新项目中使用.

因此,共享按钮的替代项是赞"按钮:
https://developers.facebook.com/docs/reference/plugins/like/ [ ^ ]

要实现赞"按钮,只需将以下内容添加到页面中:

Hi,

Facebook does no more actively support the Share button. It should still work, but should no more be used in new projects.

So the replacement for the Share Button is the Like-Button:
https://developers.facebook.com/docs/reference/plugins/like/[^]

To implement a Like-Button, you just have to add the following to your page:

<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:like href="http://www.codeproject.com/" send="true" width="450" show_faces="true" font=""></fb:like>



该代码是直接从上面的链接复制的,页面可以为您生成代码.

希望这会有所帮助.

致以诚挚的问候,祝您编程愉快,
停止



This code was directly copied from the above link, the page can generate the code for you.

Hope this helps.

Best regards and happy coding,
Stops


这篇关于Facebook分享功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆