且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

FaceBook登录按钮错误:调用FB.init()前调用FB.login()

更新时间:2023-12-06 15:44:34

对我来说,对应用程序本身有一些问题。所以我删除了FB中的旧应用程序,并创建了一个新的应用程序,并且事情刚刚开始工作。


I am getting this error after doing this code:

 <div id="fb-root"></div>
 <script src="http://connect.facebook.net/en_US/all.js"></script>
 <script>
   FB.init({
     appId  : 'realIdInTheCode',
     status : true, // check login status
     cookie : true, // enable cookies to allow the server to access the session
     xfbml  : true  // parse XFBML
   });
 </script>

<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=realIdInTheCode&amp;xfbml=1">
</script><fb:login-button show-faces="false" width="200" max-rows="1"></fb:login-button>

Which to my thinking is calling the init() before the login()

But I still get that error: Error: FB.login() called before calling FB.init().

I am in kind of total confusion at this point, so I'd really appreciate the help :)

For me, it turned out to be some problem with the app itself. So I deleted the old app in FB and made a new one, and things just started to work.