title: JSON parse error response "status":200,"statusText":"OK"
body: <p>I am trying to send JSON object but in result it is sending a parse error .</p>
  
  <pre><code>{"readyState":4,"responseText":"","status":200,"statusText":"OK"}
  </code></pre>
  
  <p>here is code</p>
  
  <pre><code>var data = {
    fb_id: response.id,
    email: response.email,
    name: response.name,
    first_name: response.first_name,
    last_name: response.last_name,
    verified: response.verified,
    birthday:response.birthday,
    picture: response.picture.data.url,
    hometown: response.hometown.name,
    gender: response.gender 
  };
  $.ajax({
    url:'connect.php',
    type: 'POST',
    data: {
      user: data
    },
    dataType: 'JSON',
    success: function(html){
      //page();
      console.log(JSON.stringify(data));
    },
    error: function(XMLHttpRequest, textStatus, errorThrown) {
      if (XMLHttpRequest.readyState == 4) {
        console.log(JSON.stringify(XMLHttpRequest));
      }
    }
  </code></pre>
  
  <p>});            </p>
  
  <p>and the backend is here:
  The JSON object is sending here</p>
  
  <pre><code>if(isset($_POST['user'])) {
    //convert json object to php associative array
    $data = $_POST['user'];
    $fbid = $data['fb_id'];             // To Get Facebook ID
    $fbfullname = $data['name']; // To Get Facebook full name
    $femail = $data['email'];    // To Get Facebook email ID
    $fbname = $data['first_name'];
    $fblname = $data['last_name'];
    $fbgender = $data['gender'];
    $fverified = $data['verified'];
    $faddress = $data['hometown'];
    $fbirth = $data['birthday'];
    $img = $data['picture'];
  </code></pre>
  
  <p>}</p>
  
  <p>The object is sending something like that:</p>
  
  <pre><code>{
      "fb_id":"xxxxxxxxxxx99",
  
      "email":"sxxxxxx@xxx.in",
  
      "name":"Sagar xxxx",
      ...
  }
  </code></pre>
  
  <p>PS: I am using 1.12.4 version of jquery.min.js</p>
  
  <p><strong>Updated</strong>
  When I tries to send request using this query to connect.php page it returns error in console log. and If i change dataType to "text" or exclude it then it doesn't return any error but then connect.php cannot identify any query posted using ajax request ,i.e., isset($_POST['user']) will not be able to identify any query .</p>