Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7839529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:27:58+00:00 2026-06-02T15:27:58+00:00

I was trying to implement a simple Facebook social plugin comment box onto my

  • 0

I was trying to implement a simple Facebook social plugin comment box onto my website. The URL of the box is not static, since every post on my site has one of them, but is generated using PHP.

I got it working fine for a while, but suddenly it stopped doing so and now I can’t get it back again. I’m not too familiar with Facebook development, so I might’ve made a mistake in the code.

Here’s how I load the Facebook Javascript SDK (I changed some fields for anonymity):

<div id='fb-root'></div>
<script>
window.fbAsyncInit = function() {
        FB.init({
          appId      : MY_ID,
          channelUrl : 'http://www.mysite.com/channel.php', 
          status     : true, // check login status
          cookie     : true, // enable cookies to allow the server to access the session
          xfbml      : true  // parse XFBML
        });

        // Additional initialization code here
      };

      // Load the SDK Asynchronously
      (function(d){
         var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
         if (d.getElementById(id)) {return;}
         js = d.createElement('script'); js.id = id; js.async = true;

         js.src = '//connect.facebook.net/en_US/all.js';
         ref.parentNode.insertBefore(js, ref);
       }(document));
</script>

And here is how I initialize the comment box:

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

<div class='fb-comments' data-href='http://mysite.com/post?id=<?php echo $id; ?>' data-num-posts='4' data-width='470'></div>

Here’s channel.php:

<?php
header("Pragma: public");
$cache_expire = 60*60*24*365;
header("Cache-Control: max-age=".$cache_expire);
header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$cache_expire) . ' GMT');
?>
<!DOCTYPE html>
<script src="//connect.facebook.net/en_US/all.js"></script>

I pasted the scripts at the end of the page in the body. Right now, nothing is showing up at all— no errors, just blank. Any help about getting this to work would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T15:28:01+00:00Added an answer on June 2, 2026 at 3:28 pm

    Sorry guys, but the whole thing was caused by a stupid mistake of mine: I had a Firefox addon that was blocking the commenting box. It actually works fine. I apologize for my mistake.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Iam trying to implement a simple JMS(traditional not using springs) code in eclipse using
I'm trying to implement a simple watermark on a text box that disappears when
I'm trying to implement a simple Facebook chat application on Android. It lets the
I'm trying to implement a simple plugin system which will allow people to write
I've been trying to implement simple low level keyhook using JNI and all went
I'm getting acquanted with Core Animation and trying to implement simple movement along a
Just trying to implement a simple audit logging solution with Grails 2.0.2 and it
I'm trying to implement a simple horizontal navigation menu that just shows a single
I am trying to implement a simple request to Wikipedia's API using AJAX (XMLHttpRequest).
I am trying to implement a simple authorization strategy for my Wicket application. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.