①$.get();
function delHotMonthly(hotMonthlyId){
if(confirm("确定要删除该记录?")){
var url = "<%=request.getContextPath() %>/admin/hotMonthly/delete.do?hotMonthlyId="+hotMonthlyId;
$.get(url,function(data){
if(data=="success"){
document.location.reload();
}
});
}
原文链接:https://www.f2er.com/ajax/163317.htmlif(confirm("确定要删除该记录?")){
var url = "<%=request.getContextPath() %>/admin/hotMonthly/delete.do?hotMonthlyId="+hotMonthlyId;
$.get(url,function(data){
if(data=="success"){
document.location.reload();
}
});
}
}
①对应java后台
@RequestMapping(value="/delete")
public void deleteHotMonthlyPackage(@RequestParam("hotMonthlyId") Long hotMonthlyId,PrintWriter out){ hotMonthlyPackageService.deleteHotMonthlyPackage(hotMonthlyId); out.write("success");//为了jsp页面获取到返回值后重新加载页面 out.close(); }