javascript - updateStatusCallback not defined on facebook examble of JQuery - Stack Overflow

So, I'm trying to integrate my html with facebook, add facebook login, share, that sort of stuff,

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
Add a ment  | 

1 Answer 1

Reset to default 6

That'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
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745418909a4626878.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信