What I have is this.
The HTML
<div id="catcher"></div>
The jQuery
jQuery.ajax({
url:'./ajax.html',
async: true,
success: function(response){
for (var key in response){
jQuery('#catcher')
.append("<ul>"+ key +"<li>" + response[key].toString() + "</li></ul>");
}
}
})
The JSON looks like
{
"Item":"Item Name",
"Item 1":"Item Name",
"Item 2":"Item Name",
"Item 3":"Item Name",
"Item 4":"Item Name"
}
I would like to make a UL like this
- Item
- Item Name
- Item 1
- Item Name
And so on. What I am getting now is each individual letter of the value of the object and a numbers for the key. Instead I want them both to be equal to the strings.