jQuery datatable accepts data as an array of arrays. Therefore, you need to convert your data from an array of objects to an array of arrays.
var pageData = [{ "id": "2", "slug": "about\/history", "title": "History", "last_updated": "2013-04-21 09:50:41" }, { "id": "3", "slug": "about", "title": "About", "last_updated": "2013-04-21 10:42:22" }]; var aaPageData = []; for (var i = 0; i < pageData.length; i++) { var item = pageData[i]; aaPageData[i] = [item.slug, item.title, item.last_updated, item.id]; } $(document).ready(function () { $("#table").dataTable({ "aaData": aaPageData, "aoColumns": [{ "sTitle": "slug", }, { "sTitle": "title" }, { "sTitle": "last_updated" }, { "sTitle": "id" }] }); });
demo: http://jsfiddle.net/BYcsk/
EDIT: No need to convert. You can achieve this by specifying the mData property for the columns. The error goes as you did not give it.
var pageData = [{ "id": "2", "slug": "about\/history", "title": "History", "last_updated": "2013-04-21 09:50:41" }, { "id": "3", "slug": "about", "title": "About", "last_updated": "2013-04-21 10:42:22" }]; $(document).ready(function () { $("#table").dataTable({ "aaData": pageData, "aoColumns": [{ "sTitle": "slug", "mData": "slug" }, { "sTitle": "title", "mData": "title" }, { "sTitle": "last_updated", "mData": "last_updated" }, { "sTitle": "id", "mData": "id" }] }); });
demo: http://jsfiddle.net/BYcsk/3/