title: Requested JSON parse failed
body: <p>By some reason there's a parsing error with the ajax code below. How could I find out what it is, and/or can someone see what's wrong?</p>
  
  <pre><code>$('#listElements').sortable({
          //revert: true,
          update: function(event, ui) {
  
              var order = [];
              $('.listObject li').each(function (e) {
                  order.push($(this).attr('id'));
              });
              $.ajax({
                  type: "POST",
                  url: "index.php?",
                  dataType: "json",
                  data: { json: order },                  error: function(jqXHR, exception) {
                      if (jqXHR.status === 0) {
                          alert('Not connect.\n Verify Network.');
                      } else if (jqXHR.status == 404) {
                          alert('Requested page not found. [404]');
                      } else if (jqXHR.status == 500) {
                          alert('Internal Server Error [500].');
                      } else if (exception === 'parsererror') {
                          alert('Requested JSON parse failed.');
                      } else if (exception === 'timeout') {
                          alert('Time out error.');
                      } else if (exception === 'abort') {
                          alert('Ajax request aborted.');
                      } else {
                          alert('Uncaught Error.\n' + jqXHR.responseText);
                      }
                  }
              });
          }
  </code></pre>