Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 17th, 2012  |  syntax: None  |  size: 0.46 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. facebook getResponse() method - allow login
  2. <script>
  3.      FB.init({
  4.         appId:'YOUR_APP_ID', cookie:true,
  5.         status:true, xfbml:true
  6.      });
  7.      FB.api('/me', function(user) {
  8.        if(user != null) {
  9.           var image = document.getElementById('image');
  10.           image.src = 'https://graph.facebook.com/' + user.id + '/picture';
  11.           var name = document.getElementById('name');
  12.           name.innerHTML = user.name
  13.        }
  14.      });
  15.    </script>