2011-12-20 57 views
1

從我大約一週前(切換到OAuth 2.0,我相信)在包含http://connect.facebook.net/en_US/all.js的Safari中加載頁面時出現以下錯誤。Safari中的Facebook JavaScript API錯誤:TypeError:'undefined'不是一個對象(評估'b.fbCallID = a.id')

TypeError: 'undefined' is not an object (evaluating 'b.fbCallID=a.id') 

我的標記和JavaScript如下:

<fb:login-button scope="email">Login with Facebook</fb:login-button> 

$(function() { 
    FB.init({ 
     appId: '12345', 
     cookie: true, 
     status: true, 
     xfbml: true 
    }); 

    FB.login(function(response) { 
     if (response.authResponse) { 
      document.cookie = 'access_token=' + response.authResponse.accessToken; 
      window.location.reload(); 
     } 
    }); 
}); 

這以前工作的罰款,並預期在Chrome仍然是工作。有沒有人看過這個?在此先感謝您的幫助。

回答

0

我能夠通過改變FB.login調用下面來解決這個問題:

FB.Event.subscribe('auth.login', function(response) { 
    if (response.authResponse) { 
     document.cookie = 'access_token=' + response.authResponse.accessToken; 
     window.location.reload(); 
    } 
}); 
相關問題