Question

not sure but seems I've read this is the unofficial forum to use for Facebook developer questions (and no doubt the source for many solutions in general).

I've recently tried to add a like and comment plugin to the end of my articles on an online newspaper, however, nothing shows up on any browser. I created it as an app (for app id purposes) and created a page for said app.

I've generated the code via this link ( https://developers.facebook.com/docs/plugins ).

Like button example: added the API call just below the body tag...

<body>
<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=XXXXXXXXXXXXXXXX";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
...

and the required html tags...

<div class="fb-like" data-href="http://mywebsite.com/article.php?num=<? echo $number; ?>" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>

I get the following errors via chrome's console...

1)The endpoint used to load this resource has been deprecated.
Please update to the current Facebook JavaScript SDK.
https://developers.facebook.com/docs/reference/javascript/
FB.Share:53
2)  Invalid App Id: Must be a number or numeric string representing the application id. FB.Share:53
3)  The "fb-root" div has not been created, auto-creating FB.Share:53
4)  FB.getLoginStatus() called before calling FB.init().

Any ideas as to why this is happening would be great. I can provide a live link, but preferably only if necessary.

Was it helpful?

Solution

Looks like the old method I was using stopped all calls to the Facebook API. The following line was the culprit...

<script src="static.ak.fbcdn.net/connect.php/js/FB.Share"; type="text/javascript"></script>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top