2010-10-14 115 views

回答

3

http://developers.facebook.com/docs/reference/plugins/login

如果你想改变形象,必须手动做:

<div id='login'><a href="#" id='facebook-login' onclick='fblogin();'><img src="your image url here" /></a></div> 
</a> 
<script> 
    function fblogin(){ 
     FB.login(function(response) { 
      if (response.session) { 
       if (response.perms) { 
        // user is logged in and granted some permissions. 
        // perms is a comma separated list of granted permissions 
        window.location.reload(); 
       } else { 
        // user is logged in, but did not grant any permissions 
        window.location.reload(); 
       } 
      } else { 
       // user is not logged in 
       window.location.reload(); 
      } 
     }, {perms:'email'}); 
     return false; 
    } 
</script> 
+0

如何更改按钮上有外观和感觉? – RadiantHex 2010-10-14 14:20:41

+0

@RadiantHex - 他把''放在哪里,只要把你想要的任何Facebook连接图像放在那里。 – 2010-10-14 14:34:12

+0

非常感谢编辑! =) – RadiantHex 2010-10-15 08:55:37

1

“与Facebook连接”仅仅是同一个按钮的早期设计。如果你真的想使用它,你可以获取“使用Facebook登录”的代码,调整它看起来像“连接Facebook”,并把它内联,但我会建议反对它,因为这样的解决方案是脆弱的,将当Facebook改变一些东西时,这些都会被打破。