title: Sending JSON to server, using jQuery
body: <p>I am trying to send simple data to theservre, and I need a "rough and ready" way to do this.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>var emails = ['a@123.com', 'b@123.com', 'c@123.com'];
  
  var ruff_json = "{ 'emails': [";
  for (i in emails)
      ruff_json += ((i == 0) ? '' : ', ') + '\''+emails[i]+'\'';
  
  ruff_json += '] }';
  
  jQuery.ajax({
      type: 'POST',
      url: '1.php',
      data: ruff_json,
      dataType: "json",
      timeout: 2000,
      success: function(result){
          //do something
      },
      error: function (xhr, ajaxOptions, thrownError){
          //do something
      }
  });
  </code></pre>
  
  <p>Using Firebug, I can see that the data is POSTed to the server - however, at the server, there is no data ($_POST is empty) - what am I doing wrong?</p>