0

Hello fellow Daniwebians, having a bit of trouble setting up the like button and comments box on my individual articles (local news website).

I've created an app (for the purposes of having an app ID) and created a page for that app. I'm now attempting to use Facebook's developer plugins page to create the needed code ( https://developers.facebook.com/docs/plugins ).

Using the like button setup as an example:
I've copied the API code and placed it just below the opening <body> tag like so...

<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 added the required html elements at the bottom of my article page...

<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>

The like button, however, is not showing up in any browser. I've looked at google's console errors and have the following errors.

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().

I generated this code via the link at the start of this post. This is supposed to be the official up-to-date facebook developer link right? I've also tried to use this debug link I found, but there are no warnings or errors ( https://developers.facebook.com/tools/debug/ ). I can provide a live link if absolutely needed. No luck finding a solution for the last few hours, any ideas are much appreciated!

Edited by PsychicTide

1
Contributor
1
Reply
62
Views
3 Years
Discussion Span
Last Post by PsychicTide
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.