getLoginStatus不在IE7上被烧 [英] getLoginStatus not Fired on IE7

查看:113
本文介绍了getLoginStatus不在IE7上被烧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让JS SDK在IE7中运行。我尝试了几个示例代码,它们都可以在Chrome,FF甚至IE8中正常工作,但是IE7不会触发getLoginStatus事件所有这些例子。
设置频道网址。 Domainsettings是正确的,Sandbox已关闭。



即使在fbrell,似乎getLoginStatus不工作。



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



该示例在IE7 / XP(VMWare Player)或浏览器堆栈上不适用于我。
对于状态(页面顶部)保持在状态:等待状态。



有人可以确认此问题(2013年10月30日)?

解决方案

我可以确认此问题。



当我添加代码以查看到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回调函数的任何内容。我的问题是:是否支持IE7支持IE7禁用IE7?



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

  //添加了这个代码以启用console.log IE7 
var console = {
panel:$(parent.document.body).append('< div>'),
log:function(m){
this .panel.prepend( '< DIV>' + M + '< / DIV>');
}
};
window.fbAsyncInit = function(){
// init FB JS SDK
FB.init({
appId:'XXXXXXXXXX',//应用程序信息中心的应用程序ID
status:true,//检查Facebook登录状态
xfbml:true,//查找页面上的社交插件
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(未授权);
} else {
console.log(未登录到Facebook);
}
},true);

};

//异步加载SDK
(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);
}());


I'am trying to get the JS SDK running in IE7. I tried several example Codes and they are all working fine in Chrome , FF even IE8 - but IE7 does not fire the getLoginStatus Event an all these examples. Channel URL is set. Domainsettings are correct, Sandbox is off.

Even on fbrell it seems getLoginStatus is not working.

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

The sample does not work for me on IE7 / XP (VMWare Player) or on Browser Stack. On fbrell the Status (top on page) stays on "Status: Waiting".

Can someone confirm this issue (Oct 30th, 2013)?

解决方案

I can confirm this issue.

When I added code to see what writes to console.log i got something like this in 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 does not write anything from inside FB.getLoginStatus callback function. Other browsers do.

My question is: Is Facebook Connect Javascript SDK support for IE7 disabled?

Here is my javascript code, jQuery (1.8.3) included before:

//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);
}());

这篇关于getLoginStatus不在IE7上被烧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆