window.confirm 参数就只有一个。显示提示框的信息。按确定,返回true;按取消返回false。
<script>
var bln = window.confirm("确定吗?");
alert(bln)
</script>
<html><script type="text/javascript">
function confirmDelete(userId){
if(confirm("是否确认删除?")){
window.location="UserServlet?flag=delete&userId="+userId;
}
}
</script>
<head>
<title></title>
</head>
<body>
<table >
<tr align="center">
<td>用户编号</td>
<td>用户名</td>
<td>操作</td>
</tr>
<tr align="center">
<td>${user.userId }</td>
<td>${user.username}</td>
<td>
<a href="javascript:confirmDelete(${user.userId })">删除</a>
</td>
</tr>
</table>
</body>
</html>