Facebook 分享按钮与描述集成,图片问题!

发布于 2024-11-07 17:29:13 字数 1553 浏览 0 评论 0原文

我在与我的网站集成共享按钮时遇到问题。 当我点击分享时,它只显示我的网站网址。它不显示图像和描述可能是什么问题???

下面是我的代码:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <title>Welcome  Facebook Read Eval Log Loop</title>
    <meta name="description" content="Examples for the Facebook Platform.">
    <meta name="keywords" content="facebook, connect, facebook connect, javascript,    examples, javascript sdk, javascript library, library, howto, tutorial, api, facebook apisdk">
    <meta property="fb:admins" content="5526183">
    <meta property="fb:app_id" content="123865001025929">
    <meta property="og:image" content="https://fbrell.com/logo.jpg">
    <meta property="og:type" content="website">
    <meta property="og:url" content="http://fbrell.com/">
</head>
<body>
    <div id="fb-root"></div>
    <script src="http://connect.facebook.net/en_US/all.js"></script>

    <script>
    FB.init({
             appId  : '123865001025929',
             status : true, // check login status
             cookie : true, // enable cookies to allow the server to access the session
             xfbml  : true  // parse XFBML
    });
    </script>
    <fb:share-button href="http://fbrell.com" type="button"> </fb:share-button>
</body>
</html>

I am facing problem in share button integration with my website.
When i click share it is only showing my website url.It is not showing image and description what might be the problem ???

Below is my code:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <title>Welcome  Facebook Read Eval Log Loop</title>
    <meta name="description" content="Examples for the Facebook Platform.">
    <meta name="keywords" content="facebook, connect, facebook connect, javascript,    examples, javascript sdk, javascript library, library, howto, tutorial, api, facebook apisdk">
    <meta property="fb:admins" content="5526183">
    <meta property="fb:app_id" content="123865001025929">
    <meta property="og:image" content="https://fbrell.com/logo.jpg">
    <meta property="og:type" content="website">
    <meta property="og:url" content="http://fbrell.com/">
</head>
<body>
    <div id="fb-root"></div>
    <script src="http://connect.facebook.net/en_US/all.js"></script>

    <script>
    FB.init({
             appId  : '123865001025929',
             status : true, // check login status
             cookie : true, // enable cookies to allow the server to access the session
             xfbml  : true  // parse XFBML
    });
    </script>
    <fb:share-button href="http://fbrell.com" type="button"> </fb:share-button>
</body>
</html>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

々眼睛长脚气 2024-11-14 17:29:13
  1. 您缺少 og:title,因此需要添加它,例如:
  2. 按照@dwarfy 所述正确关闭标签
  3. 不要使用fb:share-button!使用 Like 插件
  1. You are missing the og:title so you need to add it, something like: <meta property="og:title" content="Welcome Facebook Read Eval Log Loop"/>
  2. close the tags properly as mentioned by @dwarfy
  3. Don't use the fb:share-button! use the Like plugin instead
橙幽之幻 2024-11-14 17:29:13

它似乎适用于 facebook linter :

http ://developers.facebook.com/tools/lint/?url=http%3A%2F%2Ffbrell.com%2F

无论如何,最好始终使用linter(在上面的链接中),以便它为您提供关于你的og标签的警告和错误,它还强制facebook刷新关于你页面的缓存信息,在你的情况下,在你添加标签后尚未刷新,我想,所以你没有看到你最后的更改......它是当您分享某些内容时 Facebook 会使用这些信息。

现在可以用了吗?

顺便说一句,它给出了这个:

Warning
Required Property Missing   og:title is required

It seems to work with the facebook linter :

http://developers.facebook.com/tools/lint/?url=http%3A%2F%2Ffbrell.com%2F

Anyway it's best to always use the linter (in the link above) so that it gives you warnings and errors about your og tags, an ALSO it force facebook to REFRESH its cached information about your page, which in your case was not yet refreshed after you added tags, I suppose, so you were not seeing your last changes ... It's this information Facebook uses when you share something.

Does it work now ?

Btw it gives this :

Warning
Required Property Missing   og:title is required
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文