i am getting this response after ajax post
Array
(
[curve] => Array
(
[0] => stdClass Object
(
[date1] => 2018
[total1] => 0
)
[1] => stdClass Object
(
[date1] => 2018
[total1] => 200
)
[2] => stdClass Object
(
[date1] => 2018
[total1] => 0
)
[3] => stdClass Object
(
[date1] => 2018
[total1] => 0
)
[4] => stdClass Object
(
[date1] => 2018
[total1] => 0
)
)
)
and my post request is as below:
$.post("<?=base_url();?>app/total_meter_feeder_r_curve", { divid: divid,id:id}, function(result)
{
alert(result);
$('.basefp').hide();
// chart.series[0].setData([first,second]);
});
i want to retrieve value on ajax success of "total1" only . how could i achieve this. on alerting result i am getting the above array.
$.eachmethod of jquery like$.each(result, function(index, value) { alert(value); });result.curve[0]->total1, arrow is used for accessing stdClass Object. I haven't tested the code though.