title: passing json object with jquery ajax
body: <p>Trying to go back to basics here and send a JSON object via ajax to my php. I can't even get to that part as I get a JSON error. Here is the jquery code:</p>
  
  <pre><code>jQuery(".deletebutton").on("click", function() {
  
          var employees = [
          { "firstName":"John" , "lastName":"Doe" },
          { "firstName":"Anna" , "lastName":"Smith" },
          { "firstName":"Peter" , "lastName": "Jones" }
          ];
  
          var dataString = JSON.stringify(employees);
  
          // Lets put our stringified json into a variable for posting
          var postArray = {json:dataString};
  
          jQuery.ajax({
              type: 'POST',
              url: 'index.php?option=com_recordings&amp;task=deletevideos&amp;format=raw',
              data: postArray,
              dataType: 'json',
              success: function(data){
                  if (data == "blah")
                      alert(data);
  
              }
          });
  });
  </code></pre>
  
  <p>I get this error (when I check <code>errorThrown</code>): SyntaxError: JSON.parse: unexpected character. I checked with jsonlint.com that it is valid JSON. What am I doing wrong?</p>