按钮代码不起作用

时间:2012-02-01 17:36:21

标签: facebook-graph-api web facebook-like

我已将类似按钮代码添加到我的网站,但似乎没有出现类似按钮。我错过了一些代码吗?贝娄是我在开发人员部分中所添加的代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta property="og:title" content="HB-Likes" />
<meta property="og:type" content="company" />
<meta property="og:url" content="http://www._________.ca" />
<meta property="og:image" content="http://www.facebook.com/photo.php?fbid=198861970127848&amp;set=a.198860893461289.56994.159210157426363&amp;type=3&amp;theater" />
<meta property="og:site_name" content="___________." />
<meta property="fb:admins" content="___________" />

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>

<div id="fb-root"></div>
<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://www.facebook.com/pages_________________" data-send="false" data-layout="button_count" data-width="200" data-show-faces="false"></div>

<fb:like href="http://developers.facebook.com/" width="450" height="80"/>

</body>





</html>

1 个答案:

答案 0 :(得分:2)

您错过了HTML标记中的fb XML命名空间

<html xmlns:fb="http://ogp.me/ns/fb#">

有关详细信息,请参阅:https://developers.facebook.com/docs/reference/plugins/like/