这是我得到的JSON响应。 Javascript警告说JSON错误,无法解析!我对这个问题的原因感到困惑。
{"sEcho":1,"iTotalRecords":"4","iTotalDisplayRecords":"4","aaData":[["59","474","1838937873"],
["60","520","1838937873"],["61","520","100004515813901"],["62","474","0"]]}
Array
(
[sEcho] => 1
[iTotalRecords] => 4
[iTotalDisplayRecords] => 4
[aaData] => Array
(
[0] => Array
(
[0] => 59
[1] => 474
[2] => 1838937873
)
[1] => Array
(
[0] => 60
[1] => 520
[2] => 1838937873
)
[2] => Array
(
[0] => 61
[1] => 520
[2] => 100004515813901
)
[3] => Array
(
[0] => 62
[1] => 474
[2] => 0
)
)
)
这是我在HTML页面中使用的脚本
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
var oTable = $('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "server_processing.php",
"aoColumns": [
{ "mData": "id" },
{ "mData": "cab_id" },
{ "mData": "user_id" }
]
} );
} );
</script>