$(function () {
$("#button3").click(function () {
var text = $("#text2").val();
//var text = "001101";
if (text != "" && text != null) {
DeleteBy_sno(text)
}
else {
alert("请输入学号");
}
});
});
function DeleteBy_sno(id) {
$.ajax({
type: "POST",
url: "Controllers/deleteBysno.ashx",
date: "id=" + id,
success: function (msg) {
if (msg) {
alert("删除成功!");
// $('#' + $(temp).attr('sno')).remove();
}
else {
alert("0");
}
}
})
}
ajax请求错了date----data
$.ajax({
type: "POST",
url: "Controllers/deleteBysno.ashx",
data: "id=" + id,
success: function (msg) {
if (msg) {
alert("删除成功!");
// $('#' + $(temp).attr('sno')).remove();
}
else {
alert("0");
}
}
})
$(document).ready(function(){
$("#button3").click(function () {
var text = $("#text2").val();
//var text = "001101";
if (text != "" && text != null) {
DeleteBy_sno(text)
}
else {
alert("请输入学号");
}
});
});
你怎么知道没有传入,代码没看出什么问题
function DeleteBy_sno(id) {
alert(id)///有输出正确的id没有?
DeleteBy_sno(text) 这行少了个";"号