0 Replies - 2073 Views - Last Post: 18 March 2013 - 09:29 AM

#1 polska03   User is offline

  • D.I.C Regular

Reputation: 5
  • View blog
  • Posts: 302
  • Joined: 28-November 09

Facebook JS SDK with ajax wont let me send data to my server

Posted 18 March 2013 - 09:29 AM

I have no idea why this will not work. I want to retrieve a friendlist using facebook SDK and then send that data to my server. I can access and get the response from facebook and display all the friends with no problem. But when I try to send that information to a php page, the program just doesnt work anymore, it will not even show the friends. The code below is just the top of my program, when I enter the ajax part the whole program dies, but when it is not there it works perfect.
  // get friends
                FB.api('/me/friends', function(response) {
                    var result_holder = document.getElementById('result_friends');
                    var friend_data = response.data.sort(sortMethod);

                url: 'test.php',
                data: friend_data,
                type: 'POST',
                dataType: 'json',
                cache: false,
                success: function(responseJSON) {

                                    . more stuff

Is This A Good Question/Topic? 0
  • +

Page 1 of 1