错误:在调用FB.init()之前调用FB.login() [英] Error: FB.login() called before calling FB.init()

查看:88
本文介绍了错误:在调用FB.init()之前调用FB.login()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用此Facebook登录按钮代码:

I use this Facebook Login Button code:

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

但是调试控制台给了我这个错误: 在调用FB.init()之前先调用FB.login().

But the debug console gives me this error: FB.login() called before calling FB.init().

我做了一个测试页,以便可以看到我的错误: http://www.comehike.com/test_fb_connect.php

I made a test page so my error can be seen: http://www.comehike.com/test_fb_connect.php

我不知道我在做什么错.任何帮助将不胜感激!

I have no idea what I am doing wrong. Any help would be much appreciated!

谢谢, 亚历克斯

推荐答案

您正在两次加载Facebook脚本all.js.它应该只能加载一次.

You're loading the Facebook script all.js twice. It should be loaded only once.

这篇关于错误:在调用FB.init()之前调用FB.login()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆