标签:style blog http io color os ar java for
servlet
表单上 <td> <a href="javascript:void(0)" onclick="deleteRecord()"> <span id="cardid"><%=map.get("cardid")%></span>删除</a></td> jquery <script type="text/javascript" src="js/jquery-1.11.0.min.js"></script> <script type="text/javascript"> function deleteRecord() { var cardid = $(this).parent().html(); alert(cardid); $.ajax({ url : ‘cardid.do‘, type : "post", data : { ‘cardid‘ : cardid }, dataType : ‘html‘, success : function(data, status) { $(‘#name_msg‘).html(data); } }); window.location.reload(); } </script> 后台 String cardid = request.getParameter("cardid");//HttpServletRequest request
struts2
前台 <% List users = (List) request.getSession().getAttribute("users"); for (int i = 0; i < users.size(); i++) { %> <td><a href="javascript:void(0)" onclick="deleteRecord(<%=((Users) users.get(i)).getId()%>)">删除</a></td> jquery <script type="text/javascript" src="js/jquery-1.11.0.min.js"></script> <script type="text/javascript"> function deleteRecord(obj) { var userid=obj; $.ajax({ url : ‘deleteUser‘, type : "post", data : { ‘userid‘ : userid }, dataType : ‘html‘, success : function(data, status) { $(‘#name_msg‘).html(data); } }); window.location.reload(); } </script> 后台 HttpServletRequest request = (HttpServletRequest) ActionContext .getContext().get(ServletActionContext.HTTP_REQUEST); String userid = request.getParameter("userid");
标签:style blog http io color os ar java for
原文地址:http://www.cnblogs.com/manusas/p/4056102.html