Use JQuery to convert JSON array to HTML bulleted list -
how can convert array of strings represented in json format , convert html bulleted list using jquery?
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 fetching json server using ajax concerned use $.getjson()
function.
Comments
Post a Comment