2012-01-13 55 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