小弟使用Spring框架制作了个一个网站。可以查看数据库中的数据,在页面加载完毕后显示所有数据库指定表中的内容,源码如下:
$(function(){
$.post(
base_path+"/record/find.do",
{},
function(result){
if(result.success){
var list=result.data;
$(list).each(function(){
//每次遍历会得到一个笔记本对象
var table='<tr><td>'+this.record_title+'</td><td>'+this.record_time+'</td><td>'+this.record_man+'</td><td>'+this.record_content+'</td><td>'+this.record_comment+'</td><td> '+'<input type="button" value="Change" id="Change" class=""> '+'<input type="button" value="Delete" id="Delete" class=""></td></tr>';
$('#tbody').append(table);
//将数据绑定上td上,为后续的修、删除功能做准备
$('#tbody tr td:last').data("data",this);
});
}else{
alert(result.message)
}
}
);
//进入添加新数据界面
$("#ADD").click(function(){
location.href="Add.html";
});
//删除当前数据
$("#Delete").click(function(){
alert('11');
location.href="Add.html";
});
//修改当前用户密码
$("#changePassword").click(function(){
alert('11');
location.href="Add.html";
});
//返回Record页面
$("#Back").click(function(){
location.href="Record.html";
});
//确认添加一条数据
$("#add").click(function(){
add();
});
});
现在的情况是,我想给Change和Delete按钮添加动作,但是添加之后点击没有反应。请问该怎么解决呢?