首页 文章

Facebook登录回调未调用,弹出窗口不会在Win8上的IE10中关闭

提问于
浏览
0

对于我的Facebook-Application,登录Facebook并授予权限后,Facebook.login对话框不会关闭 . 我尝试了一个间隔和FB.getLoginStatus的解决方法,但是这个响应只返回“not_authorized”,即使我已经授予权限并且应用程序出现在我的帐户设置中 .

我的页面上有以下标签:

<meta http-equiv="X-UA-Compatible" content="IE=9">
<script src="//connect.facebook.net/en_US/all.js"></script>

the meta tag not seems to be the problem as described in an similar question

FB.init({
        appId: 'xxxxxxxxxxxxx', 
        status: false,
        channelUrl: 'My_Channel_File.html'
    });

channel-File包含与上面相同的脚本标记 . 我改变的其他参数很多:oauth,xfbml,cookie,status和frictionlessRequests(我在其他地方见过)

这个问题只发生在带有IE10的Win8上

提前致谢!

1 回答

  • 0

    我解决了这个问题 . 您需要异步初始化FB-jssdk:
    window.fbAsyncInit = function(){
    FB.init({
    appId:'xxxxxxxxxxxxxx',
    状态:是的,
    cookie:是的,
    xfbml:true
    });
    };

    (函数(d){
    var js,id ='facebook-jssdk',ref = d.getElementsByTagName('script')[0];
    if(d.getElementById(id)){return; }
    js = d.createElement('script'); js.id = id; js.async = true;
    js.src =“//connect.facebook.net/en_US/all.js”;
    ref.parentNode.insertBefore(js,ref);
    }(文献));
    当你这样做的时候,无论出于什么原因,FB.login的Dialog按预期结束关闭一切正常=)

    Edit: 问题是必须在IE中更改的安全属性:
    Internet属性 - >安全 - >必须启用底部"Secure Mode"的复选框,然后它将与同步和异步FB.init一起使用
    (我'm German so I don't知道英文 property 名称sry)

相关问题