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 9149311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:27:35+00:00 2026-06-17T11:27:35+00:00

Facebook SDK window.fbAsyncInit not firing on localhost? worked fine last week. <div id=fb-root></div> <script>

  • 0

Facebook SDK window.fbAsyncInit not firing on localhost? worked fine last week.

<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
        console.log("hey");
        // init the FB JS SDK
        FB.init({
          appId      : '***************', // App ID from the App Dashboard
          channelUrl : '//localhost/channel.html', // Channel File 
          status     : true, // check the login status upon init?
          cookie     : true, // set sessions 
          xfbml      : true  // parse XFBML tags on this page?
        });
}
  // Load the SDK's source Asynchronously
  // Note that the debug version is being actively developed and might 
  // contain some type checks that are overly strict. 
  // Please report such bugs using the bugs tool.
  (function(d, debug){
     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" + (debug ? "/debug" : "") + ".js";
     ref.parentNode.insertBefore(js, ref);
   }(document, /*debug*/ true));
</script>

“hey” does not fire upon loading the page

additionally I noticed that when i comment out the channel url in the “Fb.init”, but add the:

<script src="//connect.facebook.net/en_US/all.js"></script>

within the header of the file, “hey” fires upon first loading the page, but not the upon subsequent tries

To be more explicit. This is what the error in my console reads:

Uncaught SyntaxError: Unexpected token ( connect.facebook.net/en_US/all/debug.js:9237
  • 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-17T11:27:36+00:00Added an answer on June 17, 2026 at 11:27 am

    You missed loads the SDK below FB.init().

    (function(d, debug){
     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" + (debug ? "/debug" : "") + ".js";
     ref.parentNode.insertBefore(js, ref);
    }(document, /*debug*/ false));`
    

    https://developers.facebook.com/docs/reference/javascript/

    and make sure you sets up App Domains in App setting page.

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

Sidebar

Related Questions

I use the javascript to get some data from facebook using javascript sdk: window.fbAsyncInit
I found C# Facebook SDK http://csharpsdk.org/ (not sure Official or not). I want to
I guess I'm not linking the Facebook SDK properly with my project. Here's the
This is my Facebook connect Code: <script> jQuery(document).ready(function($){ $(.fb-login-button).live('click', function() { console.log('click'); fbEnsureInit(function() {
On the front-end, I've initialised FB and login using: window.fbAsyncInit = function () {
I downloaded the Facebook SDK for Android and I'm using it in my app
I'm using the Facebook SDK to allow users to share content through my app
I am using Facebook SDK in hackbook and tried to login and do all
I'm having trouble implementing the Facebook SDK in an iOS project and I suspect
I'm having trouble implementing the Facebook SDK in an iOS project. I am trying

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.