Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hello, what I a trying to accomplish is to get friends from facebook and then send all the friends to my server to process them accoridngly. SO eveyrhtign works if I dont insert the ajax statement, but as soon as I insert the ajax statement I do not see connect to facebook anymore. I am open to any other ways of doing this as well.

JavaScript
get friends
                FB.api('/me/friends', function(response) {
                    var result_holder = document.getElementById('result_friends');
                    var friend_data = response.data.sort(sortMethod);



                $.ajax({
                url: 'test.php',
                data: friend_data,
                type: 'POST',
                dataType: 'json',
                cache: false,
                success: function(responseJSON) {
                alert("HELLO");
                });

                                    .
                                    .
                                    .
                                    . more stuff
Posted

 
Share this answer
 
Thanks for the reply. But I do not understand how this works. I copied the code, changed my app id, and nothing happens, it just a plain div that show up. Please help.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900