Mike 3 年之前
父节点
当前提交
0a34759e4b
共有 1 个文件被更改,包括 8 次插入3 次删除
  1. 8 3
      desktop11/index.html

+ 8 - 3
desktop11/index.html

@@ -46,6 +46,10 @@ function checkLoginState() {               // Called when a person is finished w
     FB.getLoginStatus(function(response) {   // See the onlogin handler
         console.log(statusChangeCallback(response));
     });
+
+    FB.login(function(response) {
+        console('FB.login: ' + response);
+    }, {scope: 'public_profile,email'});
 }
 
 window.fbAsyncInit = function() {
@@ -64,9 +68,10 @@ window.fbAsyncInit = function() {
 function testAPI() {                      // Testing Graph API after login.  See statusChangeCallback() for when this call is made.
     console.log('Welcome!  Fetching your information.... ');
     FB.api('/me', function(response) {
-    console.log('Successful login for: ' + response.name + ', email = ' + response.email);
-    document.getElementById('status').innerHTML =
-        'Thanks for logging in, ' + response.name + '!';
+        console('testAPI(): ' + response);
+        console.log('Successful login for: ' + response.name + ', email = ' + response.email);
+        document.getElementById('status').innerHTML =
+            'Thanks for logging in, ' + response.name + '!';
     });
 }