Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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)?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
170 views
Welcome To Ask or Share your Answers For Others

1 Answer

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...