I'm trying to display in a list all the elements of my json.
I have a var "json" containing all my data.
What I exactly want is display the datas like this :
<ul>
<li>title + "of the first element"</li>
<li>title + "of the second element"</li>
<li>title + "of the third element"</li>
</ul>
Every time I try something with a simple "for", it only display me the last element.
The closest solution I had was with this I think:
function displayJson(){
$.each(json, function(key, value) {
$(this).html("<li>" + json[key].title + "</li>");
});
}
I'm a beginner, any help would be really appreciated !
value.titlerather thanjson[key].title.