0

我几乎已经成功地在我的应用程序中集成了 facebook 评论,但是有一些我不知道如何解决的问题。

问题是按钮/div“查看更多 X”评论和上级栏(我们可以选择排序依据)没有出现。

您可以在此链接中看到: http: //saxbox.keep.pt/community/#id/5

有 6 或 7 条评论,插件最多有 5 条评论,但没有出现按钮查看更多。

有什么建议么?


我创建了一个 HTML 文件来使用以下代码测试 Facebook 插件:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <!--xmlns:fb="http://ogp.me/ns/fb#">-->
<head>
</head>
<body>
</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/pt_PT/all.js#xfbml=1";
 fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comments" data-href="http://saxbox.keep.pt/community/" data-num-posts="2" data-width="470"></div>
</html>

即使使用这个简单的 HTML,我也没有得到查看更多按钮。插件有BUG吗?还是我做错了什么?

4

1 回答 1

0

当 facebook 尝试对页面进行 lint 时,可能会出现问题。

这可能与 url 中的哈希标记有关。有没有办法转换为查询字符串?

当我第一次在干净的浏览器中访问该页面时,我没有进入 id 5 页面,而是被重定向到某个主页。然后我不得不重新输入#id/5 才能进入真正的页面……Facebook 可能也遇到了同样的情况。

编辑

好的,我又试了一次,facebook 仍然看到错误信息:

http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fsaxbox.keep.pt%2Fcommunity%2F%23id%2F5

如果您点击此链接: http: //developers.facebook.com/tools/debug/og/echo ?q=http%3A%2F%2Fsaxbox.keep.pt%2Fcommunity%2F%23id%2F5

这是您的服务器响应的内容:请注意,没有 og 元标记,也没有评论插件。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- The HTML 4.01 Transitional DOCTYPE declaration--><!-- above set at the top of the file will set     --><!-- the browser's rendering engine into           --><!-- "Quirks Mode". Replacing this declaration     --><!-- with a "Standards Mode" doctype is supported, --><!-- but may lead to some differences in layout.   --><html>
<!-- xmlns:fb="http://ogp.me/ns/fb#">--><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!-- Default locale --><meta name="gwt:property" content="locale=pt_PT">
<!--                                                               --><!-- Consider inlining CSS to reduce the number of requested files --><!--                                                               --><!--<link type="text/css" rel="stylesheet" href="WebCommunityClient.css">--><title>weebox community</title>
<!--                                           --><!-- This script loads your compiled module.   --><!-- If you add any GWT meta tags, they must   --><!-- be added before this line.                --><!--                                           --><script type="text/javascript" language="javascript" src="webcommunityclient/webcommunityclient.nocache.js"></script><link rel="alternate" type="application/rss+xml" title="RSS" href="rss">
<meta name="title" content="weebox community">
<meta name="description" content="weebox community">
<link rel="image_src" href="logo.png">
</head>
<!--                                           --><!-- The body can have arbitrary html, or      --><!-- you can leave the body empty if you want  --><!-- to create a completely dynamic UI.        --><!--                                           --><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/pt_PT/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script><!-- OPTIONAL: include this if you want history support --><iframe src="javascript:''" id="__gwt_historyFrame" tabindex="-1" style="position: absolute; width: 0; height: 0; border: 0"></iframe>

<div id="loading" style="height: 99%;"><img src="loading.gif" alt="Loading..." style="position: relative; top: 50%; left: 50%; margin-top: -27px; margin-left: -27px;"></div>
<div id="main"></div>
</body>
</html>
于 2012-01-13T18:26:15.500 回答