facebook xid不工作 [英] facebook xid doesn't work

查看:113
本文介绍了facebook xid不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为我的网站上的每个帖子单独添加评论主题,因此我按照 http:/ /developers.facebook.com/blog/post/472 ,即我插入的代码:

i need separate comment thread for each post on my website, so i followed instructions at http://developers.facebook.com/blog/post/472, ie i inserted the code:

 <div id="fb-root"></div>
 <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
 <fb:comments href="www.mysite.com" xid="postPOST_ID_HERE"></fb:comments>

如果我尝试这个代码:

 <div id="fb-root"></div>
 <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
 <fb:comments href="http://www.mysite.com/news.php?id=POST_ID_HERE"></fb:comments>

它似乎工作,即我得到单独的注释线程每个帖子。但是根据facebook的说明href参数需要是规范的url。

it seems to work, ie i get separate comment thread per post. but according to facebook instructions href parameter needs to be canonical url. am i doing something wrong in the first case or is the second example way to go (even if against facebook manual)?

推荐答案

在第一种情况下,我做错了事情或者是第二种例子的方式我不认为你需要同时使用href和xid变量。我认为href变量是较新的版本,根据 Facebook开发人员博客这是新的代码:

I don't think you need to use both the href and the xid variables. I think the href variable is the newer version according to Facebook Developer Blog this is the new code:

<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:comments href="YOUR_CANONICAL_URL"></fb:comments>

它还说如果已安装原始注释框,请包含参数migrated =1 保留现有评论并以此为例:

It also says "If you already have the original Comments Box installed, include the parameter migrated="1" to keep existing comments" and shows this as an example:

<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:comments xid="YOUR_XID" migrated="1"></fb:comments>

我使用我在这里发布的第一个版本,但是使用像你提到的地址,它的工作原理。所以我会说第二个版本,即使它略微反对他们说的话。它为我工作正常。

I am using the first version I posted here, but using addresses like you mentioned, and it works. So I'd say go with the second version even if it goes slightly against what they say. It works properly for me.

这篇关于facebook xid不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆