我在單個頁面上列出了三種產品,我正在尋找在每個產品的側面添加小型評論框,類似於:https://www.facebook.com/SanukFootwear?ref=ts&sk=app_113298085356151。主要的問題是,我似乎無法弄清楚如何添加多個評論框到頁面。單個頁面上的多個Facebook評論框?
我試過使用HTML5和XFBML。我現在使用的代碼是:
<html xmlns:fb="http://ogp.me/ns/fb#">
<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&appId=MYAPPID";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
和
<fb:comments href="MYURL" num_posts="5" width="500" xid="product_01"></fb:comments>
看來,加入xid
到<fb:comments>
塊應該產生的徵求意見唯一列表只有那個xid。但是這不起作用。如果我做到以下幾點:
<fb:comments href="MYURL" num_posts="5" width="500" xid="product_01"></fb:comments>
<fb:comments href="MYURL" num_posts="5" width="500" xid="product_02"></fb:comments>
,並嘗試張貼任何一個,評論顯示了兩個。有什麼我錯過,以允許這些獨特的評論?
從sanuk商店Facebook網頁的代碼是這樣的:
<fb:comments xid="featured_product_56062795998_1" width="255" numposts="5" expr:href="##_1" class=" fb_iframe_widget">
<span>
<iframe id="f1f0d95ac" name="f341a4ded" scrolling="no" style="border-width: initial; border-color: initial; overflow-x: hidden; overflow-y: hidden; width: 255px; height: 572px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " class="fb_ltr" src="https://www.facebook.com/plugins/comments.php?api_key=113298085356151&channel_url=https%3A%2F%2Fs-static.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%3Fversion%3D3%23cb%3Df5542ec34%26origin%3Dhttps%253A%252F%252Fnorthsocial.com%252Ff2d77af7ec%26relation%3Dparent.parent%26transport%3Dpostmessage&locale=en_US&numposts=5&sdk=joey&title=&url=https%3A%2F%2Fnorthsocial.com%2Fapp%2Ftab%2Ffeatured_products%2Fview.php&width=255&xid=featured_product_56062795998_1"></iframe>
</span>
</fb:comments>
我不知道在哪裏,他們都可以從這個iFrame的內容。我提到了facebook開發文檔,但一直未能找到任何信息。任何幫助,將不勝感激!
由於提前,
滓
正如Heliboy23所說,只需在末尾指定一個錨。除非您使用舊版本,否則不需要使用XID。 – Chris