what is the reason of this error?
<script type="text/javascript">
dojo.xhrGet({
url: "homeChart.php",
handleAs: "json",
load: function(json) {
$m = [];
for (var i = 1; i < 10; i++) {
$m.push(parseFloat(json[i]["valor" + i]));
alert(i);
}
dojo.addOnLoad(makeCharts);
}
});
</script>
the output of homeChart.php is exactly: [200]
thanks
json is [200], which has only one thing in it (200) at index 0.
The for loop uses indices 1 through 10 — those indices aren’t defined for this array.