如何从JSON获取多个数据的ajax响应?

时间:2017-02-08 05:56:52

标签: javascript php jquery ajax

["06-Feb-2017","12-Feb-2017","5","45","40","Neha shishodia","USD","unit2","phase1","Change Request","Client Approval Awaited"]["07-Feb-2017","04-Feb-2017","6","54","48","Neha shishodia","USD","unit2","phase1","Change Request","Manager Approval Awaited"]

这是我的AJAX响应,因为我在PHP文件中使用echo json_encode($arr)进行AJAX响应。但我不知道如何从AJAX响应中获取JSON数据。

1 个答案:

答案 0 :(得分:1)

使用ajax short-handler jQuery.getJSON方法获取json对象。

jQuery.getJSON('file.php',function(arr){
   // arr holds the array, do the rest here
})