title: datatables jquery json format
body: <p>I am currently trying to implement the jquery datatables extension to produce a table of live results. These results are caused by my code behind function calling another web service.</p>
  
  <p>I have javascript gathering my parameters and im am using the jquery.ajax() function to talk to my code behind function. The datatables function require JSON in the following format </p>
  
  <pre><code>{
    "aaData": [
      [
        "Trident",
        "Internet Explorer 5.0",
        "Win 95+",
        "5",
        "C"
      ]
   ]
  }
  </code></pre>
  
  <p>I dont know how to get my functions response e.g. a string of comma separated information into the above format. </p>
  
  <p>I have looked into json.net extension but I am not sure what approach to take. Considering that ever time my function runs I will be adding to the JSON which will need to be in a .txt file for datatables</p>
  
  <p>Any suggestions appreciated! </p>
  
  <p>Thanks</p>
  
  <p>Code I currently have </p>
  
  <pre><code>var oTable;
  $(document).ready ( function(){
        oTable=$('#mytable').dataTable({
         "sAjaxSource": 'TestData.txt'
     });
   });​
  </code></pre>
  
  <p>and to call my code behind and get a string back </p>
  
  <pre><code>function asyncServerCall(inputs) {
          jQuery.ajax({
              url: 'Process.aspx/SearchBtnAjax',
              data: JSON.stringify({ cities: inputs }),
              type: "POST",
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function(data) {
              alert(data.d);
              oTable.fnReloadAjax();
               }
          });
      }
  </code></pre>