dop2144 2011-06-16 13:33
浏览 29
已采纳

XFBML和Facebook登录按钮[重复]

Possible Duplicate:
XFBML and the Facebook Login button

I'm trying to add the "Login using Facebook" button that you see on many sites and want to use the methods they outline here and here.

However, I don't think I'm doing this correctly. At the top of my site, my header reads:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">

Just like they indicate in the second link I posted.

They say to use the following code to have the Connect using Facebook button (which is shown in the first link (APP_ID is there intentionally... my code DOES use my app ID):

<script src="http://connect.facebook.net/en_US/all.js"></script>
  <script>
     FB.init({ 
        appId:'APP_ID', cookie:true, 
        status:true, xfbml:true 
     });
  </script>
  <fb:login-button>Login with Facebook</fb:login-button>

But when I use this code on my site the Login with Facebook button is nowhere to be seen. What am I doing wrong here? I'm fairly sure it isn't quite this simple.

  • 写回答

1条回答 默认 最新

  • dsd119120 2011-06-16 13:39
    关注

    you always need to have <div id="fb-root"></div> before script loading.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥60 ESP32怎么烧录自启动程序
  • ¥50 html2canvas超出滚动条不显示
  • ¥15 java业务性能问题求解(sql,业务设计相关)
  • ¥15 52810 尾椎c三个a 写蓝牙地址
  • ¥15 elmos524.33 eeprom的读写问题
  • ¥15 使用Java milo连接Kepserver服务端报错?
  • ¥15 用ADS设计一款的射频功率放大器
  • ¥15 怎么求交点连线的理论解?
  • ¥20 软件开发方法学习来了
  • ¥15 微信小程序商城如何实现多商户收款 平台分润抽成