Why is FB.getLoginStatus not working in IE7?

I am using FB.getLoginStatus for an application on Facebook. This works well in all browsers, including IE8. But this does not work for IE7. My code is:

  FB.getLoginStatus(function(response) { if (response.session) { alert("logout"); } else{ FB.Event.subscribe('auth.login', function(response) { login(); }); alert("login"); } }); 

Does anyone know why?

+7
source share
2 answers

According to the documentation in http://developers.facebook.com/docs/reference/javascript/fb.init/ the correct solution is to create a file on your web server (for example channel.html ) containing only:

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

And then specifying the absolute URL of your channel.html in your init parameters:

  <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 ease of deployment, I use the following to calculate my channelUrl.

  var curLoc = window.location; curLoc.protocol + "//" + curLoc.hostname + ":" + curLoc.port + "/channel.html" 
+10
source

Currently, this API (FB.getLoginStatus) no longer works in IE7 browsers.

Take a look here: getLoginStatus not starting in IE7

If you try to run the code on the next page in IE7, it does not work: http://www.fbrell.com/auth/login-and-logout

The "channelUrl" fix seems to no longer work, and IE7 support for the Javascript SDK for Facebook is compromised.

0
source

All Articles