Cannot make comments from facebook like button
Asked Answered
C

2

6

I get the like button code from https://developers.facebook.com/docs/reference/plugins/like/, and on my page, the like button is rendered correctly...at least it looks like so :P

But when I click on the like button, the comment dialog appear and disappear immediately, and the button becomes a Confirm link; then I click on the like, a popup window ask me to confirm to like it...then, when I back to my page, I can see the comment dialog. But whatever I input, after I clicked on the Post button, the dialog will not close.

In my Chrome console, I see when I click on the Post button, a request is make to https://www.facebook.com/plugins/like/comment, and the return result is:

for (;;);{"__ar":1,"payload":null}

I compared this behavior on other sites, and it is clear the return is different. But I have no idea why.

Chrystel answered 10/12, 2012 at 15:1 Comment(1)
same happens to me when i put the like button on my tumblr. did anybody find a solution to this??Nuclide
M
0

Usually that problem can be fixed by using an app id in the init code:

<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/de_DE/all.js#xfbml=1&appId=xxxxxxxxx";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

That´s Facebooks spam protection...

Meyerhof answered 10/12, 2012 at 15:48 Comment(7)
But I am not creating a FB app, I just want to have the like button. Can I just use my userId instead?Chrystel
But I am not creating a FB app, I just want to have the like button. I tried to use my FB userId, does not work...instead, the button disappeared... :(Chrystel
no, it has to be an app id. it´s quite easy to create one actually, you don´t need to program anything, just do some settings: developers.facebook.com/appsMeyerhof
I'm having this exact same issue and I am using an AppID. I've searched all over Google and StackExchange and other seem to have the issue too, but no one is offering a fix. Any ideas?Scheck
it´s also possible that the domain is well known for spam on facebook. is it your own domain or do you only use a subdomain of a bigger server?Meyerhof
@luschn, well...that's a big for testing...i am using localhost xDChrystel
it will only work if your localhost is accessible from facebook then. it´s not that easy with localhost, that´s why i recommend using a webhost even for testing.Meyerhof
P
0

actually what luschn is right. you should create appID. facebook needs to count the LIKES when one clicks on it. you know, it's so simple. perhaps there's something you need to grab from the button :p

Try this stuff:

<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/de_DE/all.js#xfbml=1&appId=null";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<span class="fb-like" data-href="https://www.facebook.com/fb-name"  data-layout="button" data-action="like"></span>

appID set into null. This works, but it's spamming. This is just for experiments only.

Here's the sample page: http://developer.appacyber.net/feed/test.php It also works on localhost :D

Prosecutor answered 9/11, 2014 at 17:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.