Note that there are some explanatory texts on larger screens.

plurals
  1. POFacebook application development 101
    primarykey
    data
    text
    <p>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.</p> <p>From the bare minimum I understand that I need to:</p> <ol> <li>Setup some opengraph items which appears to be nothing more than some meta tags.</li> <li>I need to include a script as written below just after my body tag:</li> <li>I have to run a script: just below the </li> <li>My HTML requires some code listed below.</li> <li>I can include the Facebook PHP library.</li> </ol> <p>1) What is the purpose of the opengraph meta tags? Does this influence my application at all?</p> <p>2) The script:</p> <pre><code>&lt;!-- Load the Facebook SDK --&gt; &lt;div id="fb-root"&gt;&lt;/div&gt; &lt;script src="http://connect.facebook.net/en_US/all.js"&gt;&lt;/script&gt; &lt;script&gt; // 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)); &lt;/script&gt; </code></pre> <p>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?</p> <pre><code>&lt;script src="http://connect.facebook.net/en_US/all.js"&gt;&lt;/script&gt; </code></pre> <p>4) My HTML tag is changed to the code below. What and why is this required?</p> <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="https://www.facebook.com/2008/fbml"&gt; </code></pre> <p>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?</p> <p>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? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload