In my jQuery mobile app, I want to display the result from a web service in a list. How do I create the list dynamically?
Better yet,
$.each(
a ,
function(i,v) {
$("#target_id").append("- " + v + "
") ;
}
) ;
Where a
is an Array of Objects for the list content, i
is the index variable passed to the callback function by jQuery.each
($.each
) and v
is the value for that index.
For reference: http://api.jquery.com/jQuery.each/ .