Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You have several API to to that. I recommend that you use the last one, the graph API. Then you have several SDK, I know PHP and Javascript SDK.</p> <p>In javascript, with jQuery you can do</p> <pre><code>&lt;body&gt; &lt;div&gt; &lt;button id="login"&gt;Login&lt;/button&gt; &lt;button id="logout"&gt;Logout&lt;/button&gt; &lt;button id="disconnect"&gt;Disconnect&lt;/button&gt; &lt;/div&gt; &lt;div id="user-info"&gt;&lt;/div&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; // initialize the library with the API key FB.init({ apiKey: 'YOUR_API_KEY' }); // fetch the status on load FB.getLoginStatus(handleSessionResponse); $('#login').bind('click', function() { FB.login(handleSessionResponse, { // here you specify the perms your application requires perms:'publish_stream, offline_access, manage_pages, read_stream' }); }); $('#logout').bind('click', function() { FB.logout(handleSessionResponse); }); $('#disconnect').bind('click', function() { FB.api({ method: 'Auth.revokeAuthorization' }, function(response) { clearDisplay(); }); }); // no user, clear display function clearDisplay() { $('#user-info').hide('fast'); } // handle a session response from any of the auth related calls function handleSessionResponse(response) { // if we dont have a session, just hide the user info if (!response.session) { clearDisplay(); return; } // if we have a session, query for the user's profile picture and name FB.api('/me/accounts', function(response) { $('#user-info').html(JSON.stringify(response)); }); } &lt;/script&gt; &lt;/body&gt; </code></pre> <p>This example is taken from the documentation of the JavaScript SDK. You need to get you API_KEY from the facebook developper page <a href="http://www.facebook.com/developers/apps.php" rel="nofollow">http://www.facebook.com/developers/apps.php</a></p>
 

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