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