大约一周前(我相信是 OAuth 2.0 的转换),当包含 http://connect.facebook.net/en_US/all.js 时,我在 Safari 中的页面加载时收到以下错误。
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 中仍然按预期工作。还有其他人看过这个吗?预先感谢您的帮助。
最佳答案
我可以通过将 FB.login
调用更改为以下内容来解决此问题:
FB.Event.subscribe('auth.login', function(response) {
if (response.authResponse) {
document.cookie = 'access_token=' + response.authResponse.accessToken;
window.location.reload();
}
});
关于javascript - Safari 中的 Facebook JavaScript API 错误 : TypeError: 'undefined' is not an object (evaluating 'b.fbCallID=a.id' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8569692/