Facebook喜欢打开图表的问题

时间:2011-09-06 14:57:59

标签: html facebook-like open-graph-protocol

我正在尝试将Facebook开放图表集成到我的网站中,但我通过URL Linter运行它并收到错误:“必需属性丢失,og:titleand og:url是必需的”。这是我的产品的描述页面。

我错过了什么吗?

<html xmlns="http://www.w3.org/1999/xhtml"  xml:lang="en" xmlns:fb="http://www.facebook.com/2008/fbml"  xmlns:og="http://ogp.me/ns#" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Description" content="" />
<meta name="keywords" content="hard drives, electronics, cctv, cables, psu" />
<meta name="document-classification" content="" />

<meta property="og:title" content="CAT5e UTP PATCH ETHERNET NETWORK CABLE LEAD 0.5M GREEN" />
<meta property="og:type" content="product"/>
<meta property="og:url" content="http://apps.facebook.com/maplinuk/buynow-id-10015,20015-cat5e-utp-patch-ethernet-network-cable-lead-0-5m-green.html" />
<meta property="og:image" content="http://www.247topseller.co.uk/clientstores/maplinuk/prod_image/rj45_250300.jpg" />
<meta property="og:site_name" content="maplinuk" />
<meta property="fb:app_id" content="{clipped}"/>
<meta property="og:description" content="CAT5e UTP PATCH ETHERNET NETWORK CABLE LEAD 0.5M GREEN" />

</head>
<body>
<div id="fb-root"></div>
<script type="text/javascript">

window.fbAsyncInit = function() {
FB.init({appId: '{clipped}', status: true, cookie: true, xfbml: true});

  };
(function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
    document.getElementById('fb-root').appendChild(e);
}());
</script>
<fb:like href="http://apps.facebook.com/maplinuk/buynow-id-10015,20015-cat5e-utp-patch-ethernet-network-cable-lead-0-5m-green.html" show_faces="true" width="450" font="">    </fb:like>
</body>
</html>

1 个答案:

答案 0 :(得分:1)

我认为问题出现是因为你的og:url指向一个应用页面(你的,我猜)。

就我所知,Like按钮的Facebook代码将转到该URL并尝试从那里检索元数据 - 而不是从您在此处发布的原始页面。

因此,错误消息告诉您Facebook中的应用页面没有这些元数据元素。

我已经更详细地解释了the use of og:url

大卫

相关问题