title: DataTables: Cannot read property 'length' of undefined
body: <p>I understand this a popular issue, and I have read all the similar questions here on Stack Overflow and other sites (including the datatables website).</p>
  
  <p>To clarify, I am using</p>
  
  <ul>
  <li>PHP Codeigniter</li>
  <li>Materliazecss</li>
  </ul>
  
  <p>I have also made sure that I received the JSON array correctly:</p>
  
  <pre><code>[{"name_en":"hello","phone":"55555555"},{"name_en":"hi","phone":"00000000"}]
  </code></pre>
  
  <p>My HTML table looks like this:</p>
  
  <pre><code>&lt;table id="customer_table"&gt;
       &lt;thead&gt;
           &lt;tr&gt;
              &lt;th&gt;Name&lt;/th&gt;
              &lt;th&gt;Phone&lt;/th&gt;
           &lt;/tr&gt;
       &lt;/thead&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>And here is my <code>document.ready</code> function:</p>
  
  <pre><code>  $(document).ready(function(){
              //$('#customer_table').DataTable();
              $('#customer_table').DataTable( {
                  "ajax": 'json',
                  "dataSrc": "",
                   "columns": [
                      { "data": "email" },
                      { "data": "name_en" }
                  ]
              });
    });
  </code></pre>
  
  <p>The error I am getting is</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'length' of undefined</p>
  </blockquote>