喜欢Box只是空白屏幕或只是按钮部分?

时间:2012-12-11 09:53:48

标签: facebook-likebox

我想将Like Box放在朋友的网站上,但是当我使用iframe代码然后预览它时,它只会出现Like Box的Like Button部分。当我使用html5代码然后在浏览器中预览时,我得到的只是一个空白屏幕。我尝试在此处查看以前的问题并找到一些提示(修改& amp到&等)但我仍然无法使其工作。此外,我看到的大多数帮助都是针对Wordpress的,而我并没有使用它。 Like Box需要MySQL还是 _ ?感谢您提供的任何帮助!

iframe代码的测试页:

<!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>
<title>try</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>
<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2FJaytamangPhotography&;width=520&;height=558&;show_faces=true&;colorscheme=dark&;stream=true&;border_color=black&;header=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:520px; height:558px;" allowTransparency="true"></iframe>
</body>
</html>

HTML5的测试页:

<!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>
<title>try</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</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-box" data-href="http://www.facebook.com/JaytamangPhotography" data-width="520" data-height="460" data-show-faces="true" data-colorscheme="dark" data-stream="true" data-border-color="black" data-header="false"></div>
</body>
</html>

2 个答案:

答案 0 :(得分:0)

您的iframe src网址是无意义的,因为您将&;放在其中的每个位置&(在用HTML编写时,分别为&amp;)。

HTML5版本什么都不做,因为你没有正确初始化JS SDK。 (需要app id。)

答案 1 :(得分:0)

在您登录和退出Facebook时测试它是否有效。如果它在您登录时有效但在注销时显示为空白,则Facebook页面上可能存在人口统计限制。 (例如:“仅向美国用户显示此页面”或“仅向18岁以上的用户显示页面”)当用户退出时,Facebook上没有任何人口统计信息,因此默认情况下不会显示有关页面的任何内容。