I'm trying to get the data of a json but not when looking for a data throws me the error.
Uncaught TypeError: Can not read property 'day' of undefined
$.ajax({
url: url,
//dataType: 'json',
type: 'POST',
jsonpCallback: "myJSON",
success: function (json) {
alert(json);
var subjson = json.substring(7, json.length-1);
alert(subjson);
var jsonValido = JSON.stringify(eval("(" + subjson + ")"));
var jsonFinal = JSON.parse(JSONize(jsonValido));
alert(jsonFinal);
//$("#resultado").html(json);
alert("obtencion de datos: Dia" + jsonFinal[0]['dia'] + " A: " + jsonFinal[0]['A']);
$("#resultado").html(jsonFinal[0]);
}
I have reviewed how to obtain data and I saw that this is the jsonFinal[0]['dia']
form, but I have not managed to access them.
The json to which I am consulting the data has this format
{'dia':'01-08-2016','A':'3','B':'5','C':'33','D':'34','E':'3'},{'dia':'02-08-2016','A':'3','B':'3','C':'38','D':'30','E':'3'}