title: How can I use a local JSON object as a data source for jQuery DataTables
body: <p>I have a local JSON object formatted like this:</p>
  
  <pre><code>[{
      "id": "58",
      "country_code": "UK",
      "title": "Legal Director",
      "pubdate": "2012-03-08 00:00:00",
      "url": "http://..."
  },{
      "id": "59",
      "country_code": "UK",
      "title": "Solutions Architect,",
      "pubdate": "2012-02-23 00:00:00",
      "url": "http://..."
  },{
      // ....more of the same......
  }]
  </code></pre>
  
  <p>I would like to set this as the data source for a jQuery <a href="http://datatables.net/blog/Extended_data_source_options_with_DataTables" rel="noreferrer">datatable</a> and have tried this:</p>
  
  <pre><code>testdata = '{{ jobsJSON | raw }}'; //twig template tag
  console.log(testdata);
  $('#test').dataTable({
      "aoData": testdata,
      "aoColumns": [
          { "mDataProp": "id" },
          { "mDataProp": "country_code" },
          { "mDataProp": "title" },
          { "mDataProp": "pubdate" },
          { "mDataProp": "url" }
      ]
  });
  </code></pre>
  
  <p>The DataTables plugin loads and attempts to draw the table but gives the error 'No data available in table'</p>
  
  <p>I am not making an AJAX call and just want to access the JSON object from a local JS variable.</p>