Facebook 评论适用于 URL /index.php?cID=122,但不适用于 /blog/myblogpost
在crete5(PHP CMS)中,我创建了一个基本的Facebook评论块,当URL采用形式时,该评论块可以完美运行http://mysite.com/index.php?cID=122 但当 URL 为 http://mysite.com/blog/myblogpost(这是规范 URL)。当使用 Facebook 评论发起的规范 URL 时,会出现三个指示正在加载的脉冲框,然后该部分消失并且不显示任何内容;没有错误。登录到crete5 没有什么区别。
添加代码以在该部分的 href 参数中包含规范 URL 并不会改变此行为。
我不知道这是 Concrete5 的怪癖还是我使用 Facebook 代码的方式有问题,有人可以建议如何解决这个问题吗?
代码块如下所示:
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
<fb:comments href="http://mysite.com/blog/myblogpost"></fb:comments>
<script type="text/javascript"> FB.init(MYAPIKEYHERE, "xd_receiver.htm"); </script>
In concrete5 (PHP CMS) I created a basic Facebook comment block which works perfectly when the URL is in the form http://mysite.com/index.php?cID=122 but not when the URL is http://mysite.com/blog/myblogpost (which is the canonical URL). When using the canonical URL the facebook comments initiates, the three pulsing boxes that indicate loading appear, then the section vanished and displays nothing; there is no error. Being logged into concrete5 makes no difference.
Adding code to include the canonical URL in the href parameter of the section did not change this behaviour.
I don't know if this is a Concrete5 quirk or a problem with the way I'm using the Facebook code, can anyone suggest how to resolve this?
The block of code looks like this:
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
<fb:comments href="http://mysite.com/blog/myblogpost"></fb:comments>
<script type="text/javascript"> FB.init(MYAPIKEYHERE, "xd_receiver.htm"); </script>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
FeatureLoader.js.php 已弃用(请参阅 http://developers.facebook.com/docs/reference /oldjavascript/),您应该使用全新的 Javascript SDK (http://developers.facebook.com/docs/reference/javascript)。
请用它重新编码,它应该可以解决您的问题。
FeatureLoader.js.php is deprecated (see http://developers.facebook.com/docs/reference/oldjavascript/) and you should use the all-new Javascript SDK (http://developers.facebook.com/docs/reference/javascript).
Please recode with that and it should fix your issue.