Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. $(document).ready(function() {
  2. $("#facebook_link").click(function() {
  3. //setTimeout(fb);
  4. fb();
  5. return false;
  6. });
  7.  
  8. function fb() {
  9. FB.getLoginStatus(function(response) {
  10. if (response.session) {
  11. // logged in and connected user, someone you know
  12. gotResponse(response);
  13. } else {
  14. // no user session available, someone you dont know
  15. FB.login(function(response) {
  16. if (response.session) {
  17. // user successfully logged in
  18. gotResponse(response);
  19. } else {
  20. // user cancelled login, do nothing
  21. }
  22. });
  23. }
  24. });
  25. }
  26.  
  27. function gotResponse(response) {
  28. console.dir(response);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement