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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:08:44+00:00 2026-06-13T11:08:44+00:00

This is going to be as beginner a question with getting started as you’re

  • 0

This is going to be as beginner a question with getting started as you’re like to encounter.

I’ve done previous programming with Facebook but not directly as web programming – so, I know my way around the Graph API and how things work in general, but I don’t have any experience doing web programming and I’m a little lost on how to get from Facebook’s documentation to having a working web page that lets me log in (the goal is to just have as plain of HTML/JavaScript as possible, but allowing uploading of images and posting links and such on walls using the publish_stream permission).

Here’s the code I have so far from going through what Facebook has told me to do (and the small amount I added on from having seen a small amount of HTML before now):

<!DOCTYPE html>
<html>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<head>
    The title of the document (test text)
</head>
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
// init the Facebook JavaScript SDK
    FB.init({
        appId       : 'EDITED OUT FOR PRIVACY BUT IS VALID IN MY CODE',
        channelUrl  : null,
        status      : true,
        cookie      : false,
        xfbml       : false
    });

    FB.getLoginStatus(function(response) {
        if (response.status === 'connected') {
            // connected
        } else if (response.status === 'not_authorized') {
            // not authorized
            login();
        } else {
            // not_logged_in
            login();
        }
    });
};

function login() {
    FB.login(function(response) {
        if (response.authResponse) {
            // connected
            testAPI();
        } else {
            // cancelled
        }
    });
}

function testAPI() {
    console.log('Welcome!  Fetching your information... ');
    FB.api('/me', function(response) {
        console.log('Good to see you, ' + response.name + '.');
    });
}

(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>
</body>
</html>

When I save this as a .html file and drop it into Firefox, nothing is displayed (unless I type in some hello world text before </body>). I’ve looked into JavaScript / HTML tutorials on how to get things running, but to no avail.

I know that it says in the Prerequisites section of a previous link (I’d link it again but I’m too new here and stackoverflow won’t let me) that “You’ll need somewhere that let’s you host HTML files online.” It also references Heroku, but any resource I can find on that takes me to app-hosting, and I don’t get why (this is just to test this functionality) I would need to host it online in the first place instead of just dropping it into my browser (or call ShellExecute from C/C++ to get it to run).

[EDIT:] Thanks for all your help so far everyone, I just wish I hadn’t taken up time with typos so far instead of allowing all you helpful people to get to the root of the problem.

  • 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-13T11:08:45+00:00Added an answer on June 13, 2026 at 11:08 am

    The reason the page is blank is because, no display HTML was intended to be shown. The point of the example was to demonstrate the login and API calls.

    If you logged in already, then you will not see anything as indicated at

    FB.getLoginStatus(function(response) {
            if (response.status === 'connected') {
                // connected
                            // <----- no calls
            } else if (response.status === 'not_authorized') {
                // not authorized
                login();
            } else {
                // not_logged_in
                login();
            }
        });
    };
    

    So if you want to know if it is working when you have logged in already, try placing testAPI() here

    if (response.status === 'connected') {
        // connected
        testAPI(); // <---------------
    } else if (response.status === 'not_authorized') {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may be a beginners question but not having much luck getting this going.
This is a beginner's question, but I am interested in learning what's going on
Ok, this is going to be a really embarrassing question, but I looked like
This is going to be a stupid question but I have spent an inordinate
Okay, this might be a very silly beginner question, but: I've got an ClassA,
Beginner question concerning changing the information in a view (and not going to a
I am new to iPhone-Programming and I am probably asking a beginner's question, but
This is an absolute beginner's question, but per the latest podcast, I understand that
Once again a very beginner-ish question, but here I go: I would like to
This is going to be a quick discussion, but I just wanted some feedback

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.