I have following array return from server side:
[json] => Array
(
[0] => {"sEcho":1,"iTotalRecords":"4","iTotalDisplayRecords":"4","bid":"22","aaData":[[1,"Monetary Bid name","12","4.00","6.00","-",".25\/50","-"],[2,"Monetary Bid name","14","5.00","8.00","-","1\/2","-"],[3,"Monetary Bid name","12","87.00","52.56","-","-","-"],[4,"Monetary Bid name","42","22.00","33.00","LH","3\/6","1"]]}
[1] => {"sEcho":1,"iTotalRecords":"2","iTotalDisplayRecords":"2","bid":"23","aaData":[[1,"Second Challenge Bid","12","5.00","4.00","NLH",".10\/.20","1"],[2,"Second Challenge Bid","15","7.00","4.00","PLO",".25\/50","1"]]}
[2] => {"sEcho":1,"iTotalRecords":"0","iTotalDisplayRecords":"0","bid":"24","aaData":[]}
)
How can I get/iterate values of this array through jQuery each function.
Iam getting following json response:
{"sEcho":1,"iTotalRecords":"4","iTotalDisplayRecords":"4","bid":"22","aaData":[[1,"Monetary Bid name","12","4.00","6.00","-",".25\/50","-"],[2,"Monetary Bid name","14","5.00","8.00","-","1\/2","-"],[3,"Monetary Bid name","12","87.00","52.56","-","-","-"],[4,"Monetary Bid name","42","22.00","33.00","LH","3\/6","1"]]},
{"sEcho":1,"iTotalRecords":"2","iTotalDisplayRecords":"2","bid":"23","aaData":[[1,"Second Challenge Bid","12","5.00","4.00","NLH",".10\/.20","1"],[2,"Second Challenge Bid","15","7.00","4.00","PLO",".25\/50","1"]]},
{"sEcho":1,"iTotalRecords":"0","iTotalDisplayRecords":"0","bid":"24","aaData":[]}
How can I get values of ‘iTotalRecords’, ‘aaData’ etc through each loop. Currently Iam using following loop, but it is returning ‘undefined’
jQuery(json).each(function(k, v){
alert(json.aaData[k][2]);
});
Thanks in advance
Example how to create unordered list with
sEcho