首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Facebook连接/图形-带有fb的Internet Explorer中的问题:登录对话框(未关闭)

Facebook连接/图形-带有fb的Internet Explorer中的问题:登录对话框(未关闭)
EN

Stack Overflow用户
提问于 2011-06-20 13:55:40
回答 1查看 2.2K关注 0票数 0

我已经为PHP开发了一个facebook应用程序。它在除IE8之外的所有浏览器上都工作得很好。

代码语言:javascript
复制
<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> 

我写的一个in头

代码语言:javascript
复制
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en" lang="en">

它会显示弹出窗口

代码语言:javascript
复制
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 

任何帮助都将得到评价。

EN

回答 1

Stack Overflow用户

发布于 2011-06-21 13:57:21

我的facebook登录按钮最近也不再对IE8起作用了。这个按钮以前是有效的,所以我认为Facebook最近可能更新了他们的SDK,破坏了他们之前对这个问题的修复(我看到了类似的报告,可以追溯到3年前)。

在尝试了很多其他人的建议后,除了一个建议之外什么都不起作用,那就是通过将自定义频道url添加到您的FB.init函数中。在文档中,他们给出的使用它的理由没有涵盖这个特定的问题,但使用它确实对我有效。FB.init文档可在以下位置找到:

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

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

代码语言:javascript
复制
FB.init({
         appId  : 'YOURAPPID',
         status : true,
         cookie : true,
         xfbml  : true,
         channelUrl : document.location.protocol + '//YOURDOMAIN/channel.html', 
       });

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

代码语言:javascript
复制
<script src="//connect.facebook.net/en_US/all.js"></script>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6407319

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档