关于js,想要实现点击删除弹出确认框 当只有第一个有确认框
<title>测试查询(包含模糊查询)</title><scriptsrc="${pageContext.request.contextPath}/script/jque...
<title>测试查询(包含模糊查询)</title><script src="${pageContext.request.contextPath}/script/jquery-1.7.2.js" type="text/javascript"></script><script type="text/javascript">$(function(){ $("#deleteuser").click(function(){ var flag = confirm("确定要删除的信息吗?"); return flag; }); });</script></head><body> <form action="query.do" method="post" > <table> <tr> <!-- --> <td> UserName: </td> <td> <input type="text" name="username"> </td> </tr> <tr> <td> email:</td> <td> <input type="text" name="email"> </td> </tr> <tr> <td> Phone:</td> <td> <input type="text" name="phone"> </td> </tr> <tr> <td> <input type="submit" name="Query"> </td> <td> <a href="">Add New User</a> </td> </tr> </table> </form> <!-- 将查询结果显示出来 --> <br><br> <% List<User> users = ( List<User> )request.getAttribute("users"); if(users != null && users.size() > 0){ %> <hr> <br><br> <table border="1" cellpadding="10" cellspacing="0"> <tr> <th>用户Id</th> <th>用户名</th> <th>用户密码</th> <th>用户个人简介</th> <th>UPDATE/DELETE</th> </tr> <% /* 遍历 */ for(User user:users ){ %> <tr> <td><%= user.getId() %></td> <td><%= user.getUsername() %></td> <td><%= user.getPassword() %></td> <td><%= user.getIntroduce() %></td> <td> <a href = "addUser.do"> UPDATE </a> <a href = "deleteUser.do?id=<%= user.getId() %>" id="deleteuser"> DELETE </a> </td> </tr> <% } } %> </table></body></html>
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询