RajaSekar
RajaSekar

Reputation: 398

Facebook button not loading in chrome

facebook button not display am getting an text only in chrome but it works in firefox.

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

<div id="fb-root"></div>
<fb:login-button scope="email,user_about_me,user_interests,user_location,publish_stream" width="width_value"  size="large">Login with Facebook</fb:login-button>

Am jus getting text "Login with Facebbok"

<script src="http://connect.facebook.net/en_US/all.js"></script>   
<script>
 // Initiate FB Object
 FB.init({
   appId: '<?= YOUR_APP_ID ?>', 
   status: true,
   cookie: true, 
   xfbml: true
   });
 // Reloading after successfull login
 FB.Event.subscribe('auth.login', function(response) { 
 window.location.reload(); 
 });
</script>

Chrome output

Firefox Output

Upvotes: 1

Views: 334

Answers (1)

Adam Elsodaney
Adam Elsodaney

Reputation: 7818

Change the Facebook SDK script src to be scheme-relative, ie without the http:

<script src="//connect.facebook.net/en_US/all.js"></script>

This failed initially because Chrome will block scripts transferred via HTTP when HTTPS is used, which is by default when you go to view your app in Facebook. Firefox on the other hand isn't as fussy.

Upvotes: 1

Related Questions