title: datatable stuck in Cannot read property length of undefined
body: <p>I have been trying to use jquery Datatable to display response from an API. I have tested it will HTML table and it displays fine. But the page is too long so I need to use a table with pagination.</p>
  
  <p>I got Datatable plugin. I have implemented what I saw, did a lot of googling and here on StackOverflow but no head way yet.</p>
  
  <p>I dont know what I am doing wrong</p>
  
  <pre><code>jQuery(document).ready(function() {
    var url = window.location.href;
    var Id = url.substring(url.lastIndexOf('=') + 1);
  
    debugger
      jQuery('#ppViewHistoryPage').DataTable( {
          "ajaxSource": 'https://api.premiumpension.com/multichannel/api/Prices/GetFundPriceByDateRange?fundId='+Id+'&amp;startDate=2014-1-1&amp;endDate=2050-1-1',
         "columns": [
              { "result": "FundName" },
              { "result": "ValueDate" },
              { "result": "UnitPrice" },
          ]
  
  
      } );
  } );
  </code></pre>