2013-10-30 38 views
-1

我试图获得在IE7中运行的JS SDK。我尝试了几个示例代码,并且它们在Chrome,FF甚至IE8中都可以正常工作 - 但IE7不会触发getLoginStatus事件。 设置了频道URL。网域设置是正确的,沙盒已关闭。getLoginStatus未在IE7上触发

即使在fbrell上,它似乎getLoginStatus不起作用。

http://www.fbrell.com/auth/login-and-logout

样品不能在IE7/XP(VMWare的播放器)或浏览器堆栈为我工作。 在页面上,状态(页面顶部)保持“状态:正在等待”。

有人可以证实这个问题(2013年10月30日)?

回答

0

我可以证实这个问题。

当我加入的代码,看看有什么写CONSOLE.LOG我得到了IE7是这样的:

Xdm.swf: connect%3A%20http%253A%252F%252Fmysub.domain.com%252Ff2e554600043906 
Xdm.swf: init(channel%20f2e554600043906%2C%20callback%20FB.__globalCallbacks.f3d029e404a5be4) 
Xdm.swf: FB.__globalCallbacks.f1628eb66d1241 

IE7不会FB.getLoginStatus回调函数里面写东西。其他浏览器可以。

我的问题是:是否禁用Facebook Connect Javascript SDK对IE7的支持?

这里是我的javascript代码,jQuery的(1.8.3)包括前:

//Added this code to enable use of console.log for IE7 
var console = { 
    panel: $(parent.document.body).append('<div>'), 
    log: function(m){ 
     this.panel.prepend('<div>'+m+'</div>'); 
    }  
}; 
window.fbAsyncInit = function() { 
    // init the FB JS SDK 
    FB.init({ 
     appId  : 'XXXXXXXXXX', // App ID from the app dashboard 
     status  : true, // Check Facebook Login status 
     xfbml  : true, // Look for social plugins on the page 
     channelUrl : "//mysub.domain.com/some/sub/folders/channel.html" 
    }); 


    FB.getLoginStatus(function(response) { 
     if (response.status === 'connected') { 
      var uid = response.authResponse.userID; 
      var accessToken = response.authResponse.accessToken; 
      console.log("connected"); 
     } else if (response.status === 'not_authorized') { 
      console.log("not authorized"); 
     } else { 
      console.log("not logged in to Facebook"); 
     } 
    }, true); 

}; 

// Load the SDK asynchronously 
(function(){ 
    if (document.getElementById('facebook-jssdk')) {return;} 
    var firstScriptElement = document.getElementsByTagName('script')[0]; 
    var facebookJS = document.createElement('script'); 
    facebookJS.id = 'facebook-jssdk'; 
    facebookJS.src = '//connect.facebook.net/en_US/all.js'; 
    firstScriptElement.parentNode.insertBefore(facebookJS, firstScriptElement); 
}());