Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript codeigniter php中的Json响应无效_Javascript_Jquery_Json_Codeigniter - Fatal编程技术网

Javascript codeigniter php中的Json响应无效

Javascript codeigniter php中的Json响应无效,javascript,jquery,json,codeigniter,Javascript,Jquery,Json,Codeigniter,我想在我的网站上插入一个数据表。我在这里为php使用Codeigniter。 正如在中所提到的,我按照指示操作,返回的json对象没有任何问题(使用开发人员工具获取json对象)。我也用JsonLint验证了它,它是有效的。但我仍然会收到错误信息,即“无效Json响应”” 无效的Json响应 在我看来,这就是javascript $(document).ready(function(){ $('#table1').dataTable({ "sAjaxSource": "h

我想在我的网站上插入一个数据表。我在这里为php使用Codeigniter。 正如在中所提到的,我按照指示操作,返回的json对象没有任何问题(使用开发人员工具获取json对象)。我也用JsonLint验证了它,它是有效的。但我仍然会收到错误信息,即“无效Json响应”

无效的Json响应

在我看来,这就是javascript

$(document).ready(function(){
    $('#table1').dataTable({
        "sAjaxSource": "http://localhost/project/index.php/conM/loadMarks"
    });
});

表的id是“table1”。有人能给我一些建议吗?

您的Json源代码应该像下面的示例一样

{"draw":0,"recordsTotal":4,"recordsFiltered":4,"data":[["2","3q","qww","Active"],["3","wert","erthj","Active"],["5","testdata","test description","Active"],["6","wertyh","asdfgh","Active"]]}
可以复制粘贴ajax源代码以获得更好的帮助吗