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

  • Home
  • SEARCH
  • 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 7706345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:06:13+00:00 2026-06-01T00:06:13+00:00

I have a website that does not have page refreshes when the visitor navigates

  • 0

I have a website that does not have page refreshes when the visitor navigates to other pages (the site is similar to hotornot.com in functionality).

I’m trying to use Facebook comments, which I’ve managed to use fine for the first page the visitor lands on. When the visitor navigates to a second page I’m trying to update the comments box to be relevant to the next “page”.

Please see my code below:

<head>
    <script type="text/javascript">
        function facebookcomments() {
            fbdiv = document.getElementById("fbcm");
            fbdiv.innerHTML = '<div id="fb-root"></div>';
            (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=343149849069221";
                fjs.parentNode.insertBefore(js, fjs);
            }(document, 'script', 'facebook-jssdk'));
            hard_url = "http://www.example.com/usernames/" + thisusername + "/" + thisitem;
            showcomments = document.getElementById("show_comments");
            showcomments.innerHTML = '<div id="fb-comments" class="fb-comments" data-href="' + hard_url + '" data-num-posts="2" data-width="470" mobile="false"></div>';
        }
    </script>
</head>
<body onload="facebookcomments();">

Essentially I generate a unique URL for the page when the page loads and pass this into the Facebook comments script. This function then populates the comments div onload.

I am triggering the facebookcomments(); function when someone clicks to go to the next item on the playlist. I was hoping the innerHTML function would simply swap out the current set of comments, with the relevant set for the new “page”, however, it disappears completely instead.

Any help would be 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-01T00:06:14+00:00Added an answer on June 1, 2026 at 12:06 am

    After adding a Facebook element to your page, you need to call FB.XFBML.parse()

    Add that function call in the last line of your function and you should be fine.

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

Sidebar

Related Questions

I need to automate some tasks on a website that does not have an
I have an asp.net website StartPage that does not require signing-in, in order to
I'm using jQuery. I have website feature that does an ajax search and returns
Does anyone have some guidelines or links to articles when designing a website that
I have a website that I am working on: http://keramed.com in FireFox on my
I have a website that has an index.php, a few simple .html pages and
I have a PHP page on a website that I'd like to be accessible
I have a website in php that does include() to embed the content into
Let's say that, theoratically, I have a page / controller action in my website
I have a website that requires some secure pages for logging in, user accounts,

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.