【发布时间】:2011-12-13 17:48:21
【问题描述】:
我正在尝试在我的产品页面上实现 Facebook 的 OpenGRaph 协议。
在每一页的头部上方都有这个:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
然后在头部我有:
<meta property="og:title" content="This Page Title"/>
<meta property="og:type" content="product"/>
<meta property="og:url" content="http://www.mywebaddress.com"/>
<meta property="og:image" content="http://www.myimage.jpg"/>
<meta property="og:site_name" content="My Site Name"/>
<meta property="fb:admins" content="10101010101"/>
<meta property="og:email" content="hello@mywebaddress.com"/>
<meta property="og:description" content="Description of my product."/>
然后我有一个带有此代码的“喜欢”按钮:
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like" data-href="http://thispagesurl" data-send="true" data-width="350" data-show-faces="false"></div>
在我看来,一切似乎都在复制 Facebook Developers page 上的内容,但当我“点赞”时,Facebook 似乎只关注页面标题和一般信息。
我尝试使用他们的对象调试器“调试”页面,但收到以下警告:
Inferred Property The og:url property should be explicitly provided, even if a value can be inferred from other tags.
Inferred Property The og:title property should be explicitly provided, even if a value can be inferred from other tags.
Inferred Property The og:image property should be explicitly provided, even if a value can be inferred from other tags.
Inferred Property The og:locale property should be explicitly provided, even if a value can be inferred from other tags.
据我所知,我已完全按照 Facebook 的指示进行操作,但我并不高兴。谁能指出我做错了什么?
提前致谢, 丹
【问题讨论】:
标签: facebook facebook-opengraph