So, I'm trying to integrate my html with facebook, add facebook login, share, that sort of stuff, but I'm finding a problem. Have searched here and could find the solution for most, but not this one.
It says on the JavaScript console, after I load the html:
Uncaught ReferenceError: updateStatusCallback is not defined.
The code is small, so I'll paste it here.
<html>
<head>
<script src=".0.0/jquery.min.js"></script>
<link rel="stylesheet" href="css/style.css" />
<title>Testes</title>
<script>
$(document).ready(function() {
$.ajaxSetup({ cache: true });
$.getScript('.js', function(){
FB.init({
appId: '383086835168967',
});
$('#loginbutton,#feedbutton').removeAttr('disabled');
FB.getLoginStatus(updateStatusCallback); <-- Error ocurring on this line. More specicly, on updateStatusCallback. -->
});
});
</script>
</head>
</html>
Code found at here
So, I'm trying to integrate my html with facebook, add facebook login, share, that sort of stuff, but I'm finding a problem. Have searched here and could find the solution for most, but not this one.
It says on the JavaScript console, after I load the html:
Uncaught ReferenceError: updateStatusCallback is not defined.
The code is small, so I'll paste it here.
<html>
<head>
<script src="http://ajax.googleapis./ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<link rel="stylesheet" href="css/style.css" />
<title>Testes</title>
<script>
$(document).ready(function() {
$.ajaxSetup({ cache: true });
$.getScript('https://connect.facebook/en_UK/all.js', function(){
FB.init({
appId: '383086835168967',
});
$('#loginbutton,#feedbutton').removeAttr('disabled');
FB.getLoginStatus(updateStatusCallback); <-- Error ocurring on this line. More specicly, on updateStatusCallback. -->
});
});
</script>
</head>
</html>
Code found at here
Share Improve this question edited Jan 8, 2014 at 3:28 flx 14.2k11 gold badges58 silver badges73 bronze badges asked Jan 8, 2014 at 3:07 Miyh0Miyh0 491 silver badge7 bronze badges 1- 1 u need to define the updateStatusCallback function – iJade Commented Jan 8, 2014 at 3:10
1 Answer
Reset to default 6That's because the updateStatusCallback
logic is left to the developer. You should do:
FB.getLoginStatus(function(){
alert('Status updated!!');
// Your logic here
});
Or leave the code as you have it now, but adding this:
function updateStatusCallback(){
alert('Status updated!!');
// Your logic here
}