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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:59:14+00:00 2026-05-26T15:59:14+00:00

I am busy creating my very first Facebook application, and although I have PHP

  • 0

I am busy creating my very first Facebook application, and although I have PHP and Javascript experience, I am struggling to understand how the logic of setting up an application for Facebook works.

From the bare minimum I understand that I need to:

  1. Setup some opengraph items which appears to be nothing more than some meta tags.
  2. I need to include a script as written below just after my body tag:
  3. I have to run a script: just below the
  4. My HTML requires some code listed below.
  5. I can include the Facebook PHP library.

1) What is the purpose of the opengraph meta tags? Does this influence my application at all?

2) The script:

<!-- Load the Facebook SDK -->

    <div id="fb-root"></div>
    <script src="http://connect.facebook.net/en_US/all.js"></script>
    <script>
      // IS IT FAIR TO ASSUME THIS AREA BELOW CREATES THE FACEBOOK OBJECT? 
      window.fbAsyncInit = function() {
        FB.init({
          appId      : 'APP ID', // App ID
          status     : true, // check login status
          cookie     : true, // enable cookies to allow the server to access the session
          oauth      : true, // enable OAuth 2.0
          xfbml      : true  // parse XFBML
        });

      };

      // WHAT DOES THIS DO?

      (function(d){
         var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
         js = d.createElement('script'); js.id = id; js.async = true;
         js.src = "//connect.facebook.net/en_US/all.js";
         d.getElementsByTagName('head')[0].appendChild(js);
       }(document));
    </script>

3) The script (also above). What does this do? Can I assume this works similiar that the jQuery framework and is required for me to load the code above?

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

4) My HTML tag is changed to the code below. What and why is this required?

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:og="http://ogp.me/ns#"
  xmlns:fb="https://www.facebook.com/2008/fbml">

5) Although I understand the logic behind including the PHP library, what is the difference between the Javascript and PHP library? Does it effectively do the same thing?

Sorry for the stupid questions, but in reality, I find Facebook not very user friendly for someone to try get into the application development, as their documentation feels “scattered” and not really up to date?

  • 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-05-26T15:59:15+00:00Added an answer on May 26, 2026 at 3:59 pm

    1 – open graph protocol is explained quite well in the documentation actually. The data in there is what facebook will index for your page, so what is displayed when someone interacts with the page (e.g. a like)

    2 – In the space you have written ‘// WHAT DOES THIS DO?’, you can put methods and functionality which you want to run as soon as the facebook api has loaded. So you may want to hide all your facebook divisions etc until this point, or take some action to get the user’s login state as soon as the api is ready. Note also that you dont need this bit in your code above:

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

    This is already being loaded in your ‘(function(d){…’ bit at the bottom. Check out the documentation on loading the js api.

    3 – That is the script tag that loads the facebook js api

    4 – This is the namespace you need to tell your page about in order for it to read the og metadata. Again, this is explained well in the open graph protocol documentation

    5 – JS is client side. Php is server side.

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

Sidebar

Related Questions

I am busy creating my first MVVM application in WPF. Basically the problem I
I have been busy in my project creating a webapp (in struts) that manages
I am busy with creating a Google map v3 site. If you have a
I have a multi part question for a php script file. I am creating
I'm busy creating a resizer, but on reloading it first switches from 100% until
I have been busy creating an app for Red5. Imagine what was my surprise
I have been busy setting up authentication, a JDBC realm in particular, on GlassFish
I'm busy creating a very simplistic ruby on rails app that won't need a
I'm creating a WPF MVVM application. I have a long process that I want
i'm busy writing my very first jquery plugin and i ran into some problems.

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.