I have this JSON array:
[{"amount":"500"},{"amount":"750"},{"amount":"250"}]
I have tried to add the values it contains with:
$.getJSON('http://api.com..../water.php',function(data_water_tot){
console.log(data_water_tot);
$.each(data_water_tot,function(){
total += data_water_tot[cont].amount;
});
console.log(total);
});
I do not know how to add 400 + 750 + 250.