i have this json response:
[{
"i": 39,
"id": "15399"
},
{
"i": 38,
"id": "15386"
},
{
"i": 37,
"id": "15329"
}]
now i need to put these elements in a html list. how can i use $.each to do that?
(something like:
39: 15399
38: 15386
etc…)
(btw. i have no access to the file that generates the json code)
Just iterate over your array, for example:
In a
$.each()callback, you get the index and the object as parameters, in this case you just want to use theiandidproperties off that. The alternative is just a ordinaryforloop, like this: