首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >与开放图形类似的facebook问题

与开放图形类似的facebook问题
EN

Stack Overflow用户
提问于 2011-09-06 14:57:59
回答 1查看 1.3K关注 0票数 1

我试图将Facebook打开的图形集成到我的站点中,但是我通过URL Linter运行它,得到了错误:“必需的属性丢失,og:titleand :url是必需的”。这是我的产品的描述页。

我是不是遗漏了什么?

代码语言:javascript
复制
<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>
EN

回答 1

Stack Overflow用户

发布于 2011-09-06 15:28:42

我相信问题的出现是因为你的og:url指向一个应用程序页面(我想是你的)。

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

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

我已经更详细地解释了og:url的使用

大卫

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7321955

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档