简体   繁体   English

Facebook登录后显示空白屏幕(facebook js api)

[英]Facebook shows blank screen after login (facebook js api)

<body>
<script>
// Facebook Init
window.fbAsyncInit = function() {
FB.init({
   appId      : '...MYID...', // App ID
   channelUrl : 'channel.html', // Channel File
   status     : true, // check login status
   cookie     : true, // enable cookies to allow the server to access the session
   xfbml      : true  // parse XFBML
});

// Additional initialization code here
FB.Event.subscribe('edge.create',
function(response) {
    alert('You liked the URL: ' + response);
}
);
};

</script>

<div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1&appId=...MYID...";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>

    <div id="player"></div>
    <div id="main">

    <div id="facebook" style="height:30px;">
    <div class="fb-like" data-href="http://www.MYURL.com/about" data-send="true" data-width="450" data-show-faces="true"></div>
    </div>

Can somebody help? 有人可以帮忙吗? I am php programmer myself and just stuck with JS... I also considered the Php api, but actually it used to work, now it hangs all of sudden.. not sure what I did :( 我本人是PHP程序员,只是坚持使用JS ...我也考虑过Php api,但实际上它曾经可以工作,现在突然挂起了..不知道我做了什么:(

Thanks! 谢谢!

Please see the Facebook developer site. 请访问Facebook开发者网站。 It would be a good place to track as this is possibly not you. 这将是一个不错的追踪地点,因为这可能不是您。 I'm having the same issue and I'm using FBML tags and not iFrame or HTML5. 我遇到了同样的问题,并且使用的是FBML标签,而不是iFrame或HTML5。

https://developers.facebook.com/bugs/347759798609016 https://developers.facebook.com/bugs/347759798609016

Something else to try is to try logging in, kill that window, then refresh the page. 其他尝试是尝试登录,杀死该窗口,然后刷新页面。 For me at least the "Like" button works after the refresh. 对我来说,刷新后至少可以使用“赞”按钮。 So the login is successful, but the response from Facebook isn't. 因此登录成功,但是来自Facebook的响应未成功。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM