Answer the question
In order to leave comments, you need to log in
How to properly process JSON?
Good day.
In general, there is a JSON response from the PHP server.
I get AJaxom response processing Php script.
JS does not give the entire amount of data
The script itself.
$.ajax({
url: 'url',
type: 'POST',
dataType: 'json',
cache: false,
data: obj,
})
.success(function(data) {
// var dataDecode = JSON.parse(data);
console.log(data);
var dataObj = data.doctors[0].day;
let arrayLength = dataObj.length;
let getWeek = dataObj.length / 7;
let getweekNum = Math.floor(getWeek);
console.log(data.doctors[0]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question