th {
background-color: #0094ff;
color: #f2f4f6;
text-align: center;
}
td {
text-align: center;
}
//文档就绪
$(function () {
//跳转页面
$("#btnadd").click(function () {
location.assign("addcontacts.html");
})
search();//查询功能
})
function search() {
$("#list #newtr").remove();
var name = $("#name").val();
$.ajax({
url: "handlers/showhandlers.ashx",
type: "post",
data: { "name": name },
datatype: "json",
success: function (data) {
console.log(data);
if (data.length > 0) {
var t = $("#list");
$(data).each(function () {
t.append("
"+ "
" + this.name + ""+ "
" + (this.sex ? "男" : "女") + ""+ "
" + this.provences + ',' + this.city + ""+ "
" + this.email + ""+ "
" + this.tel + ""+ "
修改"+ "
")})
}
}
})
}
数据管理
男
女
姓名 | 性别 | 地址 | 邮箱 | 手机号 | 操作 |
---|