title: DataTables Ajax data not working
body: <p>Refer to my codes below, it's working when <code>innerData</code> is used but when <code>outerData</code> is used it's not working and telling me:</p>
  
  <blockquote>
    <p>Requested unknown parameter 'badge' for row 0</p>
  </blockquote>
  
  <p>My <code>innerData</code> and <code>outerData</code> looks the same, only the values are different.</p>
  
  <p>Appreciate it if anyone can point me to the right direction.</p>
  
  <p>EDIT:Gyrocode.com from comment below suggested <code>JSON.parse(outerData)</code> and it works like a charm.</p>
  
  <pre><code>$("#ButtonSearch").click(function(){
      try {
          companyCode = '&lt;%=Session["comp_code"].ToString()%&gt;';
          $.ajax({
              type: "POST",
              url: "MtForm.aspx/helloWorld",
              dataType: "json",
              contentType: "application/json; charset=utf-8",
              data: "{companyCode:" + JSON.stringify(companyCode) + "}",
              success: function(outerData){
                  var innerData = [{"badge":"11111111","name":"John Doe","ext":"2222","dept_name":"3333"},{"badge":"44444444","name":"Jane Doe","ext":"5555","dept_name":"6666"}];
  
                  $('#demo').html( '&lt;table cellpadding="0" cellspacing="0" border="0" class="display" id="example"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Badge&lt;/th&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Ext.&lt;/th&gt;&lt;th&gt;Dept.&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;/table&gt;' );
  
                  $('#example').dataTable({
                      "data": innerData,
                      "columns": [
                          { "data": 'badge' },
                          { "data": 'name' },
                          { "data": 'ext' },
                          { "data": 'dept_name' }
                      ]
                  });                        
              },
              error: function(xhr, status, error) {
                  console.log(xhr.responseText);
                  console.log(status);
                  console.log(error);
                  alert("error");
              }
          });
      }
      catch(err) {
          alert('Javascript error: ' + err.message);
      }
  });
  </code></pre>