Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Not sure why your code is not working and I am yet to try running it on my machine by I am posting a working code here. Please try using this code after following steps mentioned below</p> <ol> <li>Create a new app on facebook.</li> <li>In Permissions tab, select the user permissions that you want from user.</li> <li>In code mentioned below, input your app id and try running it.</li> </ol> <p>Code below is taken from <a href="http://hayageek.com/examples/oauth/facebook/oauth-javascript/index.php" rel="nofollow">http://hayageek.com/examples/oauth/facebook/oauth-javascript/index.php</a> and is basic implementation of Javascript SDK.</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;div id="fb-root"&gt;&lt;/div&gt; &lt;script&gt; window.fbAsyncInit = function() { FB.init({ appId : 'XXXX', // App ID channelUrl : 'http://192.168.1.146/facebook/index.html', // Channel File status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); FB.Event.subscribe('auth.authResponseChange', function(response) { if (response.status === 'connected') { document.getElementById("message").innerHTML += "&lt;br&gt;Connected to Facebook"; //SUCCESS } else if (response.status === 'not_authorized') { document.getElementById("message").innerHTML += "&lt;br&gt;Failed to Connect"; //FAILED } else { document.getElementById("message").innerHTML += "&lt;br&gt;Logged Out"; //UNKNOWN ERROR } }); }; function Login() { FB.login(function(response) { if (response.authResponse) { getUserInfo(); } else { console.log('User cancelled login or did not fully authorize.'); } },{scope: 'user_photos'}); } function getUserInfo() { FB.api('/me', function(response) { var str="&lt;b&gt;Name&lt;/b&gt; : "+response.name+"&lt;br&gt;"; str +="&lt;b&gt;Link: &lt;/b&gt;"+response.link+"&lt;br&gt;"; str +="&lt;b&gt;Username:&lt;/b&gt; "+response.username+"&lt;br&gt;"; str +="&lt;b&gt;id: &lt;/b&gt;"+response.id+"&lt;br&gt;"; str +="&lt;b&gt;Email:&lt;/b&gt; "+response.email+"&lt;br&gt;"; str +="&lt;input type='button' value='Get Photo' onclick='getPhoto();'/&gt;"; str +="&lt;input type='button' value='Logout' onclick='Logout();'/&gt;"; document.getElementById("status").innerHTML=str; }); } function getPhoto() { FB.api('/me/picture?type=normal', function(response) { var str="&lt;br/&gt;&lt;b&gt;Pic&lt;/b&gt; : &lt;img src='"+response.data.url+"'/&gt;"; document.getElementById("status").innerHTML+=str; }); } function Logout() { FB.logout(function(){document.location.reload();}); } // Load the SDK asynchronously (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)); &lt;/script&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Update: Hope this solves your problem, I will have a look at your tonight and explain what is going wrong with it.</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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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