标签:
案例一
http://jsfiddle.net/neerajkumarsingh/tqyn3/
<table id="records_table" border=‘1‘>
<tr>
<th>Rank</th>
<th>Content</th>
<th>UID</th>
</tr>
</table>
var jsonData = ‘[{"rank":"9","content":"Alon","UID":"5"},{"rank":"6","content":"Tala","UID":"6"}]‘;
$.ajax({
url: ‘/echo/json/‘,
type: ‘POST‘,
data: {
json: jsonData
},
success: function (response) {
var trHTML = ‘‘;
$.each(response, function (i, item) {
trHTML += ‘<tr><td>‘ + item.rank + ‘</td><td>‘ + item.content + ‘</td><td>‘ + item.UID + ‘</td></tr>‘;
});
$(‘#records_table‘).append(trHTML);
}
});
标签:
原文地址:http://www.cnblogs.com/jeremyjs/p/4481028.html