|
@@ -64,22 +64,16 @@ window.fbAsyncInit = function() {
|
|
|
function testAPI() { // Testing Graph API after login. See statusChangeCallback() for when this call is made.
|
|
|
FB.api('/me/?fields=id,name,email', function(response) {
|
|
|
console.log('FB API回傳資料: ' + JSON.stringify(response));
|
|
|
- console.log('成功登入: ' + response.name + ', email = ' + response.email + ', id = ' + response.id);
|
|
|
|
|
|
- if (response.id) {
|
|
|
- console.log('response.id = ' + response.id);
|
|
|
-
|
|
|
+ if (response.id) {
|
|
|
// 設定欄位預設值
|
|
|
- console.log('response.email = ' + response.email);
|
|
|
document.getElementById("email").value = response.email;
|
|
|
-
|
|
|
- console.log('response.name = ' + response.name);
|
|
|
document.getElementById("name").value = response.name;
|
|
|
|
|
|
console.log('隱藏FB登入按鈕');
|
|
|
|
|
|
// 隱藏FB登入按鈕
|
|
|
- $('#fb_login').hide();
|
|
|
+ document.getElementById("fb_login").style.display = 'none';
|
|
|
}
|
|
|
});
|
|
|
};
|