Advertisement
Guest User

Untitled

a guest
Dec 5th, 2012
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
  2. <head>
  3. <meta name="generator" content=
  4. "HTML Tidy for Linux/x86 (vers 11 February 2007), see www.w3.org" />
  5. <meta charset="utf-8" />
  6. <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
  7. <meta http-equiv="Pragma" content="no-cache" />
  8. <meta http-equiv="Expires" content="0" />
  9. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=IE8" />
  10.  
  11. <title>Facebook Login</title>
  12. <script type="text/javascript">
  13. //<![CDATA[
  14.  
  15.  
  16. // Load the SDK Asynchronously
  17. (function(d){
  18. var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
  19. if (d.getElementById(id)) {
  20. return;
  21. }
  22. js = d.createElement('script');
  23. js.id = id;
  24. js.async = true;
  25. js.src = "//connect.facebook.net/en_US/all.js";
  26. ref.parentNode.insertBefore(js, ref);
  27. }(document));
  28.  
  29. var appID = '0000000000000';
  30. var channelUrl = '//myhost/channel.html';
  31.  
  32. // Init the SDK upon load
  33. window.fbAsyncInit = function() {
  34.  
  35. FB.init({
  36. appId : appID, // App ID
  37. channelUrl : channelUrl,
  38. status : true, // check login status
  39. cookie : true, // enable cookies to allow the server to access the session
  40. xfbml : true // parse XFBML
  41. });
  42.  
  43. FB.Event.subscribe('auth.statusChange', function(response)
  44. {
  45. if(!response.authResponse)
  46. FB.login(finish, {scope: 'publish_actions,publish_stream'});
  47. else
  48. finish(response);
  49. });
  50.  
  51. FB.getLoginStatus(finish);
  52.  
  53. }
  54.  
  55. function finish(response)
  56. {
  57. alert("Hello "+response.name);
  58. }
  59.  
  60. //]]>
  61. </script>
  62. </head>
  63.  
  64. <body>
  65. <h1>Facebook login</h1>
  66.  
  67. <p>Do NOT close this window.</p>
  68.  
  69. <p>please wait...</p>
  70. </body>
  71. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement