jsp 代码
<a href="javascript:void(0)" οnclick="save(${row.id})">删除</a>
<a href="javascript:void(0)" οnclick="del(${row.id})">删除</a>
var contextPath = $("#contextPath").val();
//保存
function save() {
var url = ""; var data = ""; data = $("#tianjiaform").serialize(); url = contextPath+"/kbm/kbmAction_upload.action"; $.ajax({ type: "POST", url: url, data: data, success: function(msg){ alert("成功添加表单基本信息"); location.reload(); } }); }//删除操作
function del(id) { var url = contextPath+"/xx/xxx.action"; var result = confirm("确认删除该记录"); if (result==true){ $.ajax({ type: "POST", url: url, data: { id: id }, success: function(msg){ alert("表单基本信息成功删除"); location.reload(); } }); }}