課后作業(yè) ,希望能指出問(wèn)題,提出更好的方法, 僅供參考
在前面加一個(gè)<input id="deleteOne" type="hidden" name="id"/>
后面
<td>
<a href="#">修改</a>
<a href="javascript:deleteOne(${message.id })" onclick="delcfm();">刪除</a>
</td>
js文件
//確認(rèn)刪除
function delcfm(){
if(!confirm("確認(rèn)刪除嗎?")){
window.event.returnValue = false;
}
}
//批量刪除方法
function ?deleteBatch(basePath){
$("#mainForm").attr("action",basePath+"DeleteBatchServlet");
$("#mainForm").submit();?
}
//單個(gè)刪除方法
function deleteOne(x){
$("#deleteOne").val(x);
$("#mainForm").attr("action","DeleteOneServlet");
$("#mainForm").submit();?
}
2017-07-24
為啥我用了上面的方法 ? href和onclick ?都沒(méi)有用了
2016-12-28
請(qǐng)問(wèn)<input id="deleteOne" type="hidden" name="id"/>加在哪里有什么用
2016-10-14
這有什么問(wèn)題?