I am facing an issue with my AJAX call where the data received from the server is not being treated as JSON, despite setting the datatype to json:
function RetrieveMateriasFromServer(callback){
var status_aux;
//HTTP request for data from the given URL. If the received data is as expected, goes into the SUCCESS case
return $.ajax({
url: 'materiasphp/materias.php',
dateType: 'json',
success: function(data)
{
status_aux = data;
callback(status_aux);
var test = JSON.stringify(data);
console.log(data);
console.log(test[1]);
}
The console prints test[1] = "["