0

I have Page Tab App, which has a landing page with a "Log In" button for users to click to install the App. Can I replace the "Log In" button with my custom image?

The current code for the "Log In" button is :

<div class="fb-login-button" data-scope="friend_likes"></div>
Raptor
  • 53,206
  • 45
  • 230
  • 366
  • 2
    Possible duplicate! http://stackoverflow.com/questions/9810335/how-to-change-facebook-login-button-with-my-custom-image – Giri Jul 07 '12 at 14:24

1 Answers1

4

You can use the JS Api for this,

function fbAuth() {
    FB.login(function(response) {
      if (response.authResponse) {
        alert('User fully authorize the app.');
      } else {
        alert('User canceled login or did not fully authorize the app.');
      }
    }, { scope: 'friend_likes' });
}

then you can call it in a custom button with the onclick event:

<a href="#" onclick="return fbAuth();">Login</a>

Facebook Documentation: FB.login

Philip
  • 5,011
  • 2
  • 30
  • 36