I have started a small API project and am at an impass and could use some help, please.
The connect is working fine and I can console.log(data) to return what is expected. What I want to do now is seperate the return data. An example of the data is "id":19, "code": 21, "type", zone. I have tried various ways to separate the index and the element, as I've called them, but cannot get it work. Any help would be greatly appreciate.
$.ajax(connect).done(function(data) {
$.each([data], function(index, element){
$('#AJAXresponse').html('<ul>' + index + ' : ' + element + '</ul>');
});
});
jsonthat is received from the api response the parenthesis and square brackets around thejsonstring make alot difference'<ul>' + index + ' : ' + element + '</ul>'it wont be nice, as a<li>is missing...