Пытаюсь получить данные с бекенда с помощью запроса следующего вида:
$(document).ready(function(){
$('.graph_period').on('submit', function(e) {
e.preventDefault();
$.ajax({
data: $(this).serialize(),
url: '/admin/statistic',
type: 'get',
dataType: 'script'
}).success(function(data) {
console.log('success');
}).error(function(error) {
console.log(error)
console.log('error');
})
return false;
});
});
В ответе приходят данные:
{"status":200,"user":{"14 08":0,"14 09":0,"14 10":0,"14 11":0,"14 12":0,"14 13":0,"14 14":0,"14 15":0,"14 16":0,"14 17":0,"14 18":0,"14 19":0,"14 20":0,"14 21":0,"14 22":0,"14 23":0,"15 00":0,"15 01":0,"15 02":0,"15 03":0,"15 04":0,"15 05":0,"15 06":0,"15 07":0,"15 08":0,"15 09":0,"15 10":0,"15 11":0,"15 12":0,"15 13":0,"15 14":0,"15 15":0,"15 16":0,"15 17":0,"15 18":0,"15 19":0,"15 20":0,"15 21":0,"15 22":0,"15 23":0,"16 00":0,"16 01":0,"16 02":0,"16 03":0,"16 04":0,"16 05":0,"16 06":0,"16 07":0},"sounds":{"14 08":0,"14 09":0,"14 10":0,"14 11":0,"14 12":0,"14 13":0,"14 14":0,"14 15":0,"14 16":0,"14 17":0,"14 18":0,"14 19":0,"14 20":0,"14 21":0,"14 22":0,"14 23":0,"15 00":0,"15 01":0,"15 02":0,"15 03":0,"15 04":0,"15 05":0,"15 06":0,"15 07":0,"15 08":0,"15 09":0,"15 10":0,"15 11":0,"15 12":0,"15 13":0,"15 14":0,"15 15":0,"15 16":0,"15 17":0,"15 18":0,"15 19":0,"15 20":0,"15 21":0,"15 22":0,"15 23":0,"16 00":0,"16 01":0,"16 02":0,"16 03":0,"16 04":0,"16 05":0,"16 06":0,"16 07":0}}
В консоль выводится блок ошибки, т.е.:
error
В данных, выводимых в консоль statusText: "OK", status: 200, responseText: получаемый JSON.
JSON на валидность проверял -
https://jsonlint.com/ говорит что валидный.
Что я упускаю?