fb.xd.resolverelation(...).fb'是 null 或不是一个对象 让我发疯
我已经尝试了几个小时才能让这个工作正常...在某些 IE 浏览器中请注意,并非所有浏览器在尝试连接 Facebook 登录时都会出现此错误。
fb.xd.resolverelation(...).fb' is null or not an object
当弹出框中的脚本在 Facebook 登录后返回我的网站时,会出现该错误。
我的连接代码如下所示
window.fbAsyncInit = function() {
FB.init({
appId : '12345',
status : true,
cookie : true,
xfbml : true,
oauth : true,
channelUrl : '//site.com/pages/channel.php',
});
function updateButton(response) {
//button = document.getElementById('fb-auth');
loginHolder = document.getElementById('faceAccess');
if (response.authResponse) {
//user is already logged in and connected
loginHolder.style.display = "none";
FB.api('/me', function(info) {
login(response, info);
});
}
}
//window.onload=function(){
// run once with current status and whenever the status changes
FB.getLoginStatus(updateButton);
FB.Event.subscribe('auth.statusChange', updateButton);
//}
};
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
I have ben trying for hours to get this working... In some IE browsers NOTE not all i get this error when trying to connect with Facebook login.
fb.xd.resolverelation(...).fb' is null or not an object
The error appears when the script inside the pop up box is going back to my site after login at Facebook.
My code looks like this for connecting
window.fbAsyncInit = function() {
FB.init({
appId : '12345',
status : true,
cookie : true,
xfbml : true,
oauth : true,
channelUrl : '//site.com/pages/channel.php',
});
function updateButton(response) {
//button = document.getElementById('fb-auth');
loginHolder = document.getElementById('faceAccess');
if (response.authResponse) {
//user is already logged in and connected
loginHolder.style.display = "none";
FB.api('/me', function(info) {
login(response, info);
});
}
}
//window.onload=function(){
// run once with current status and whenever the status changes
FB.getLoginStatus(updateButton);
FB.Event.subscribe('auth.statusChange', updateButton);
//}
};
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将
status : true,
更改为status : false,
并查看是否能提供更好的结果。Try changing
status : true,
tostatus : false,
and see if that provides better results.