简体   繁体   English

Facebook评论插件-如何登录

[英]Facebook comments plugin - How to login

I am adding the facebook comments plugin to my website and have little coding knowledge. 我正在将facebook评论插件添加到我的网站,并且几乎没有编码知识。

I have added the following after the opening body tag: 我在打开body标签之后添加了以下内容:

<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 = 'https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.11';
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

And the following where I want the comments to display: 以下是我要显示评论的位置:

<div class="fb-comments" data-href="https://www.bbuboxing.co.uk/featherweight.html" width="100%" data-width="100%" data-numposts="5">

If I or a visitor is not logged in to Facebook, the plugin displays a button saying log in to post but I can't click it to log in, the button isn't clickable. 如果我或访客未登录Facebook,该插件会显示一个按钮,显示“登录后才能发布”,但我无法单击它来登录,因此该按钮不可单击。

How do I make it so that I(or a visitor) can click this button to log in? 如何使我(或访客)可以单击此按钮登录?

you're missing your app id which needs to be appended to the end of the src property in the sdk script tag like this: 您缺少需要在sdk脚本标签中的src属性末尾附加的应用ID,如下所示:

<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 = 'https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.11&appId=XXXX';
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

replacing the XXXX with your registered facebook app id. 用您注册的Facebook应用ID替换XXXX。 if you haven't registered an app yet visit https://developers.facebook.com/ and go through the registration and signup process. 如果您尚未注册应用程序,请访问https://developers.facebook.com/并完成注册和注册过程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM