<script>
$(function () {
show();
})
function show() {
$.ajax({
url: 'http://localhost:53134/api/Student/Show',
type: 'Get',
dataType: 'json',
success: function (d) {
$("#tb").empty();
$(d).each(function () {
var line = '<tr>'
+'<td>' + this.Sname + '</td>'
+ '<td>' + (this.Sex ? "男" : "女") + '</td>'
+ '<td>' + this.Sage + '</td>'
+ '<td>' + this.Shome + '</td>'
+ '<td><input id="Button1" type="button" value="删除" onclick="Del(' + this.Sid + ')"/></td>'
+ '</tr>';
$("#tb").append(line);
})
}
})
}
function Add() {
location.href = '/Student/Index';
}
</script>