Advertisement
Guest User

Untitled

a guest
Jun 20th, 2013
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. FB.login({scope: 'email'},function(response){
  2. if(response.status == 'connected'){
  3. alert('I am connected')
  4. }
  5. });
  6.  
  7. FB.login(function(response){
  8. if(response.status == 'connected'){
  9. alert('I am connected')
  10. }
  11. },{scope: 'email'});
  12.  
  13. <!DOCTYPE html>
  14. <html>
  15. <body>
  16. <div id="fb-root"></div>
  17. <a href="#" onclick="getEmail();return false;">Get Email</a>
  18. <script src="http://connect.facebook.net/en_US/all.js"></script>
  19. <script>
  20. FB.init({ appId: '**AppID**', status: true, cookie: true, xfbml : true });
  21.  
  22. function getEmail() {
  23. FB.login(function(response) {
  24. if (response.session && response.perms) {
  25. FB.api('/me', function(response) {
  26. alert('Email: ' + response.email);
  27. }
  28. );
  29. }
  30. } , {perms:'email'});
  31. }
  32. </script>
  33. </body>
  34. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement