简体   繁体   中英

Like button doesn't post to facebook

I know there are a lot of posts on this subjects, i've read all of them, but didn;t resolve my problem.

I don't know what happened, it worked fine till a week or two ago. Now, when i click on the like button on my article, i cannot see that on facebook. More, if i write a comment on the like button, still doesn't work.

The code is:

<div class="fb-like" data-href="http://steagu.ro/index.php?id=<?php echo $myid; ?>&amp;cat=1" data-send="false" data-width="200" data-show-faces="false"></div>

I've tried it also with xfbml code, but same result.

Of course, i have the other part needed for facebook, right after body section:

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

You can test the like button here . The strange part is that I didn't make any changes to the code. The button is counting the likes, but with no effect on facebook page. Since it's happening only to me, must be an error in my website, which I wasn't able to find it

I'm not sure if this will help but i was using a similar bit of code to yours and it also stopped working so i was googling and found the following which seems to work much better:

<iframe src="https://www.facebook.com/plugins/like.php?href=http://www.youwebsitename.co.uk"
                    scrolling="no" frameborder="0" style="border: none; width: 300px; height: 20px;"></iframe>

See the following link https://developers.facebook.com/docs/guides/web/

as it mentions in the article the iframe is more widely used and easier to implement.

Hope thats helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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