I have the following .ajax
$.ajax({
url: urlpath,
type: 'POST',
dataType: 'json',
data: JSON.stringify(json),
contentType: 'application/json; charset=utf-8',
success: function (data) {
alert(JSON.stringify(data));
},
error: error
});
What I am passing back is a list with 3 columns. When I do alert(JSON.stringify(data));
it shows me the data – 3 columns and 4 rows of data. How do I go about parsing this and storing it into a table?
Say you have a table with an
id="my-table", you can substitute your alert with something like:$('#my-table tr')...find create an array with your table rows$('td', this)...apply an anonimous function on everytdof the loop currenttr(thisacts as the search context fortds