title: Parsing jQuery AJAX response
body: <p>I use the  following function to post a form to via jQuery AJAX:        </p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>$('form#add_systemgoal .error').remove();
  var formdata = $('form#add_systemgoal').serialize();
  $.ajaxSetup({async: false});  
  $.ajax({     
      type: "POST",
      url: '/admin/systemgoalssystemgoalupdate?format=html',
      data: formdata,
      success: function (data) {
          console.log(data);   
      },
  });
  </code></pre>
  
  <p>It posts fine but I cannot parse the respons, it logs to console as follows</p>
  
  <pre class="lang-js prettyprint-override"><code>{
      "success": 1,
      "inserted": {
          "goal_id": "67",
          "goalsoptions_id": "0",
          "user_id": "0",
          "value": "dsfdsaf",
          "created": "2013-06-05 09:57:38",
          "modified": null,
          "due": "2013-06-17 00:00:00",
          "status": "active",
          "actions_total": "0",
          "actions_title": "sfdgsfdgdf",
          "action_type": "input",
          "points_per_action": "1",
          "expires": "2013-06-11 00:00:00",
          "success": 1
      }
  }
  </code></pre>
  
  <p>which I believe is the response I am looking for.</p>
  
  <p>However when I try to do <code>alert(data.success);</code> or any of the other members of the response object it is <code>undefined</code>.</p>
  
  <p>Any advice appreciated.</p>