Using the new facebook graph api, ajax calls returns null (empty)

后端 未结 4 674
南旧
南旧 2020-12-16 05:58

Im trying out the new graph api for facebook. I\'m trying to fetch some data using jquery ajax. This is a sample of my javascript code, very basic...

var mU         


        
4条回答
  •  隐瞒了意图╮
    2020-12-16 06:32

    I was trying to do something similar, in testing I was able to get a working result which I saved on jsFiddle: http://jsfiddle.net/8R7J8/1/

    Script:

    var facebookGraphURL = 'https://graph.facebook.com/19292868552';
    $.ajax({
        url: facebookGraphURL,
        dataType: 'json',
        success: function(data, status) {
          $( '#output' ).html('Username: ' + data.username);
        },
        error: function(data, e1, e2) {
          $( '#output' ).html(e2);
        }
    })
    

    HTML:

    
      
        
    BorkBorkBork

    Hope that helps! :)

提交回复
热议问题