title: Titanium Mobile / Javascript Json call not working
body: <p>I am using JSON to communicate with a PHP script I have running on a remote server.
  The application makes a call to the script and sends some data around.</p>
  
  <p>I do not have much experience with JSON and I seem to be doing something wrong and I just can't find what it is.</p>
  
  <p>Tried finding my problem on google and stackoverflow, but the thing is I don't really know what the problem is as I do not have the said experience with JSON.</p>
  
  <p>Here goes:</p>
  
  <p>In a loop I am generating a temporary list which is being pushed to an array:</p>
  
  <pre>    
      var tmpData = {
         rowType: row.rowType,
         isChecked: row.isChecked,
         position: i
      };
  
      resultArr.push(tmpData);
  </pre>
  
  <p>This <code>resultArr</code> results in :</p>
  
  <pre>
  {
          isChecked = 1;
          position = 0;
          rowType = phone;
      },
          {
          isChecked = 1;
          position = 1;
          rowType = mobilephone;
      },
          {
          isChecked = 1;
          position = 2;
          rowType = email;
      },
          {
          isChecked = 0;
          position = 3;
          rowType = sms;
      }
  </pre>
  
  <p>The above is being send to a remote php script:</p>
  
  <pre>xhr.send({data : JSON.stringify(resultArr) });</pre>
  
  <p>Result in PHP:</p>
  
  <pre>
  [data] => [
  {\"rowType\":\"type1\",\"isChecked\":true,\"position\":0},
  {\"rowType\":\"type2\",\"isChecked\":true,\"position\":1},
  {\"rowType\":\"type3\",\"isChecked\":true,\"position\":2},
  {\"rowType\":\"type4\",\"isChecked\":false,\"position\":3}]
  </pre>
  
  <p>In the PHP script I need this data to save it in a database.
  However upon <code>json_decode</code> on the <code>$_POST["data"]</code> or <code>$_POST</code> the result is empty.</p>
  
  <p>So my question, what am I doing wrong?</p>