更新时间: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&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.