After the ajax request, the data returned is structured as follows:
Data = [
["18/02/2019", "A"],
["19/03/2019", "B"],
["21/05/2019", "C"],
]
The ajax request was successful and the data is stored in a variable named Data within a function.
success: function (Data) {
for(i in Data) {
// INSERT INTO HTML
}
}
I have managed to iterate through Data
and access each sublist as i
. But I am struggling with how to display this in my HTML. I tried using
document.querySelectorAll('.Appointments').innerHTML = Data[i];
but it's not working.
The desired result should be displayed on the webpage, with each row having its own division:
18/02/2019 A
19/03/2019 B
21/05/2019 C
Being new to JSON, I would greatly appreciate a detailed explanation. Thank you.