No, purtroppo li ricevo correttamente:
codice:
var cIn = [], cOut = [];
$.getJSON("ajax/reservation.php?idRef=34", function(data){
for (x = 0; x < data.length; x++) {
alert(data[x].checkIn);
alert(data[x].checkOut);
}
alert(cIn.length); //risultato corretto
})
.error(function() { alert("error"); });
alert(cIn.length); //risultato non corretto
In particolare, l' array che invio tramite PHP è questo:
codice:
[{"checkIn":"05-05-2012","checkOut":"05-12-2012","days":"7"},{"checkIn":"05-18-2012","checkOut":"05-20-2012","days":"2"}]