2012-01-13 54 views
0

我几乎成功地在我的应用程序中集成了Facebook评论,但有一些问题我不知道如何解决。GWT - 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我没有得到更多的视图按钮。该插件有什么错误?或者我做错了什么?

回答

0

当facebook试图对页面进行提升时,可能会有问题。

它可能与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> 
+0

请阅读我的编辑。即使使用简单的URL,该插件也无法正常工作。任何建议? – 2012-01-23 10:30:27

+0

请参阅上面编辑的评论。你必须解决它,所以Facebook可以甩掉页面,你也必须修复这个网址。 – DMCS 2012-01-23 15:05:10

+0

og元标签是我可以快速添加的东西。 为什么它给代码206?由于meta标签不存在? – 2012-01-23 18:08:24