Why FB.getLoginStatus doesn't work in IE7?

后端 未结 2 1447
忘了有多久
忘了有多久 2021-02-04 17:01

I am using FB.getLoginStatus for an application in Facebook. This works fine in all the browsers, including IE8. But it doesn\'t work for IE7. My code is:



        
相关标签:
2条回答
  • 2021-02-04 17:45

    According to the documentation at http://developers.facebook.com/docs/reference/javascript/fb.init/, the proper solution is to create a file on your web server (for instance channel.html) containing just:

     <script src="http://connect.facebook.net/en_US/all.js"></script>
    

    And then specifying the absolute URL to your channel.html in your init options:

     <div id="fb-root"></div>
     <script src="http://connect.facebook.net/en_US/all.js"></script>
     <script>
       FB.init({
         appId  : 'YOUR APP ID',
         channelUrl  : 'http://example.com/channel.html'  // custom channel
       });
     </script>
    

    For convenience in deployment, I use the following to calculate my channelUrl.

     var curLoc = window.location;
     curLoc.protocol + "//" + curLoc.hostname + ":" + curLoc.port + "/channel.html"
    
    0 讨论(0)
  • 2021-02-04 18:01

    Currently this API (FB.getLoginStatus) is not working anymore on IE7 browsers.

    Take a look here: getLoginStatus not Fired on IE7

    If you try to run the code in the following page on IE7 it's not working: http://www.fbrell.com/auth/login-and-logout

    It seems the "channelUrl" fix is not working anymore and the IE7 support for the Facebook Javascript SDK is compromised.

    0 讨论(0)
提交回复
热议问题