Facebook Connect / Graph - 带有fb:登录对话框的Internet Explorer中的问题(未关闭)

时间:2011-06-20 05:55:40

标签: facebook-javascript-sdk

我开发了一个PHP的facebook应用程序。它在除IE8之外的所有浏览器上都能正常工作。

<script>
      window.fbAsyncInit = function() {
        FB.init({
          appId   : '<?php echo $facebook->getAppId(); ?>',
          session : <?php echo json_encode($session); ?>, // don't refetch the session when PHP already has it
          status  : true, // check login status
          cookie  : true, // enable cookies to allow the server to access the session
          xfbml   : true // parse XFBML
        });

        // whenever the user logs in, we refresh the page
        FB.Event.subscribe('auth.login', function() {
          window.location.reload();
        });
      };

      (function() {
        var e = document.createElement('script');
        e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
        e.async = true;
        document.getElementById('fb-root').appendChild(e);
      }());
    </script> 

我写的标题

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en" lang="en">

显示带

的弹出窗口
http://static.ak.fbcdn.net/connect/xd_proxy.php?version=3#cb=fcd4e0bda699ab&origin=http%3A%2F%2Ffunkyhousemusic.com.au%2Ff2a3a0d311c1622&relation=opener&transport=flash&frame=f11105d2b30fcb8&result=%7B%22perms%22%3A%22publish_stream%22%2C%22selected_profiles%22%3A100001565152261%2C%22session%22%3A%22%7B%5C%22session_key%5C%22%3A%5C%222.AQCSnIWiw1JjiNd1.3600.1308553200.1-100001565152261%5C%22%2C%5C%22uid%5C%22%3A%5C%22100001565152261%5C%22%2C%5C%22expires%5C%22%3A1308553200%2C%5C%22secret%5C%22%3A%5C%227vpbXmKCQvEOb_tVEdBXpA__%5C%22%2C%5C%22base_domain%5C%22%3A%5C%22funkyhousemusic.com.au%5C%22%2C%5C%22access_token%5C%22%3A%5C%22161903587201698%7C2.AQCSnIWiw1JjiNd1.3600.1308553200.1-100001565152261%7CfW98-D_hw--lS8NdRCxdU51N-eA%5C%22%2C%5C%22sig%5C%22%3A%5C%22766d1359acfdb68b0226c6187413b05f%5C%22%7D%22%7D 

任何帮助都会受到欢迎

1 个答案:

答案 0 :(得分:2)

我的Facebook登录按钮最近也停止了IE8的工作。该按钮之前有效,所以我认为Facebook可能最近更新了他们的SDK,这些东西破坏了他们之前针对该问题的修复(我看到类似的报道可以追溯到3年前)。

在尝试了很多其他人的建议后,除了一个之外什么都没有用,并且通过将它添加到你的FB.init函数中来使用自定义通道URL。在文档中,他们使用它的原因不包括这个特定问题,但使用它确实对我有用。 FB.init文档可在以下网址找到:

https://developers.facebook.com/docs/reference/javascript/FB.init/

基本上你所要做的就是在FB.init函数中添加对channel.html文件的引用。

FB.init({
         appId  : 'YOURAPPID',
         status : true,
         cookie : true,
         xfbml  : true,
         channelUrl : document.location.protocol + '//YOURDOMAIN/channel.html', 
       });

然后在您指定的位置创建channel.html文件(不必位于顶级文件夹中,'// domain/some_path/channel.html'也可以工作)并且文件内部只有这一行。

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