POST a response from API by AJAX
07:01 17 Jan 2014

Im making a Login whit facebook. using the javascript sdk im geting the response (i guess is JSON), and i want to send this response to a php file to check if the user is in the database or not.

so heres what i got so far. this is the function i call when the user is loged into facebook.

 function testing(){
    FB.api('/me', function(response) { 
    response = JSON.stringify(response);
    //call another function, sending the data recived
    ajaxlog(response);
    });

    }

and here is the ajaxlog function

function ajaxlog(facedatos){
    $.ajax({
      type: "POST",
      url: "facebook-ajax-login.php",
      dataType: "json",
      data: facedatos,
      success: function(response){
        //the php brings the conect response true or false
        if(response.conect==true){
          $("#exist").html(response.data);
        }else{

        }
      },
      beforeSend: function(){
        $("#exist").html("")
      }
    });//

im doing alerts and the facebook data comes with no problem. i think the issue is how i send the data by post, im not reciving the data in the php

ajax json post