Use jQuery to convert JSON array to HTML bulleted list

var ul = $('<ul>').appendTo('body');
var json = { items: ['item 1', 'item 2', 'item 3'] };
$(json.items).each(function(index, item) {
    ul.append(
        $(document.createElement('li')).text(item)
    );
});

As far as fetching the JSON from your server using AJAX is concerned you could use the $.getJSON() function.

Live demo.

Leave a Comment