下拉菜单的级联操作(ajax)(2)

$.ajax({ url: "<%=request.getContextPath()%>/supp/deleteSupp", data : {supplierId:supplierId}, async: false, //请求是否异步,默认为异步,这也是ajax重要特性 type: "GET", //请求方式 success: function(data) { var rs = eval('('+data+')'); flag = rs.success; if(flag){ alert("删除成功!"); } } });

下面是后台java代码:

@RequestMapping("/deleteSupp") @ResponseBody public Result<String> deleteSupplier(HttpServletRequest request){ Result<String> rs = new Result<>(); String supplierId = request.getParameter("supplierId"); supplierService.deleteSupplierById(supplierId); rs.setSuccess(true); return rs; }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjpzpd.html