TL; DR:
- Started with this question simplified it after he worked and continued it here.
- I need a "GET" JSON array
- Format it correctly and for each in the array put it in the corresponding DIV.
- ??
- He works.
This is a continuation of this question for simplification and continuation.
I need some complex JSON data from an array. With him, I need a headline and its value. The reason I do this is because I will know what is called an array, but not the data that is generated inside it.
Suppose this new array looks like this:
{"Days":
[{"day": "Sunday", "time": "10.00"},
{"day": "Monday", "time": "12.00"},
{"day": "Tuesday", "time": "09.00"},
{"day": "Wednesday", "time": "10.00"},
{"day": "Thursday", "time": "02.00"},
{"day": "Friday", "time": "05.00"},
{"day": "Saturday", "time": "08.00"}
]}
Thanks Thanks (Matthew Flaschen)
, 10.00, .
:
$.getJSON(url,
function(data){
$.each(data, function(i,item){
$('.testfield').append('<p>' + item + '</p>');
});
});
:
Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
, Firebug, JSON. , - . , , ,
$('.testfield').append('<p>' + item + '</p>' + '<br />');
, .