<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title><script type="text/javascript">
function del(id){
var flag=confirm("确认删除吗");
if(flag){
document.form1.action="User_Servlet?flag=del&id="+id;
document.form1.submit();
}
}
</script>
</head><body>
<form id="form1" name="form1" method="post" action="${pageContext.request.contextPath}/User_Servlet"><input type="button" name="button" id="button" value="删除" onclick="del('${user.id}')" class="input-button" >
</body>
</html>光看方法的话貌似没问题阿
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title><script type="text/javascript">
function del(id){
var flag=confirm("确认删除吗");
if(flag){
document.form1.action="User_Servlet?flag=del&id="+id;
document.form1.submit();
}
}
</script>
</head><body>
<form id="form1" name="form1" method="post" action="${pageContext.request.contextPath}/User_Servlet"><input type="button" name="button" id="button" value="删除" onclick="del('${user.id}')" class="input-button" >
</body>
</html>光看方法的话貌似没问题阿
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货