作者:凌晨 | 来源:互联网 | 2023-05-17 10:59
$(function() {
$('#test').click(function() {
$.ajax({
url: 'fenshu.json',
// data:"[{'name':'1', 'result'':'60''}]",
type: 'get',
dataType: 'json',
success: function(json) {
var item;
$.each(json, function(i, result) {
item = "" + result['name'] + " | " + result['result'] + " |
";
$('.table').append(item);
});
}
})
})
});
[{"name":"1", "result":"60"},{"name":"aaa", "result":"50"}]