I have an Html list, I receive data as JSON dictionary from a REST call, I traverse and get their values. But I couldn’t find how to generate the Html below with items in a loop.
<div class="container">
<ul role="list">
<li class="infoBasic" role="listitem">
<div class="date">20-12-2012</div>
<div class="ammount">-€4,25</div>
</li>
<li class="infoDetails" role="listitem">
<div class="place">data</div>
<div class="category">data</div>
<div class="description_title">data</div>
<div class="description">data</div>
</li>
//repeat this for multi items received from REST
</ul>
$.ajax
({
success: function (data){
var transactions=data['transactions'];
$.each( transactions, function( key, value ) {
$.each( value, function( key, value) {
//here how to set/create the appropriate div elements(like above)
// with the values I get here in a loop?
});
});
EDIT some solutions below is fine, but I dont want all the values from my object array, how can I get only these items(date, amount, place..etc) to the html div and ignore other items in the dictionary
you can use..