Anyone notice something wrong with their login button? My codes were working, suddenly they start to behave strange today and i didn't modify any code. Here is my code to help you debug with me what is wrong possibly on my end?
I have this on header:
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId: '<?php echo $sofa['fbappid']; ?>',
status: false,
cookie: true,
xfbml: true,
oauth: true
});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
function Facebook_login () {
$("p.form-result").empty();
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
$.ajax({
url: '<?php bloginfo('template_directory'); ?>/ajax/fbconnect.php',
type: 'POST',
dataType: 'json',
success: function(data){
$('.loading').remove();
$('input:submit').attr("disabled", false);
if (data.status) {
$("p.form-result").html('<span class="success">' + data.message + '</span>');
window.setTimeout(function(){location.reload()},3000);
}
}
});
}
});
};
</script>
I have this where is my button (facebook connect)
<div class="form-fbconnect"><div class="fb-login-button" onlogin="Facebook_login()" scope="email"><?php _e('Connect with Facebook','sofa'); ?></div></div>
Something does not look right. the button loads in funny way, and it does not work like before even though it does login user. What is going on?
Thanks in advance.
You can view the current status of the Facebook platform at https://developers.facebook.com/live_status.