135-1821-9792

Springboot+thymeleaf后端直接给onclick函数赋值的实现代码

 这里是控制器里返回的 

创新互联公司是一家以重庆网站建设公司、网页设计、品牌设计、软件运维、成都网站推广、小程序App开发等移动开发为一体互联网公司。已累计为工商代办等众行业中小客户提供优质的互联网建站和软件开发服务。

  /** 
   * @param pageUtil   分页工具类 
   * @param cliCorpQuery 查询类 
   * @param model    model 
   * @return String 
   */ 
  @RequestMapping(value = {"/list"}, method = RequestMethod.GET) 
  public String list(PageUtil pageUtil, CliCorpQuery cliCorpQuery, Model model) { 
    PageUtil corps; 
    try { 
      corps = corpClientService.queryByPage(pageUtil, cliCorpQuery); 
    } catch (Exception e) { 
      logger.error("queryByPage error:" + e.getMessage()); 
      return "queryByPage error"; 
    } 
    model.addAttribute("corps", corps); 
    return VIEW_PATH + "list"; 
  } 

页面

 
                     
                     
                     
                     
                     
                     
                     
                     
                     
                     
                     
                       
                       
                     
                   

JS

function check(id, status) { 
   $.ajax({ 
     type: "POST", 
     data: {id: id, status: status}, 
     url: "/admin/corp/check", 
     success: function (data) { 
       if (data == "认证成功") { 
         window.location.href = ("/admin/corp/list"); 
       } else { 
         alert("认证失败"); 
       } 
     }, 
     error: function (data) { 
       alert("认证失败"); 
     } 
   }); 
 } 

以上所述是小编给大家介绍的Spring boot + thymeleaf 后端直接给onclick函数赋值的实现代码,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对创新互联网站的支持!


网页标题:Springboot+thymeleaf后端直接给onclick函数赋值的实现代码
网站地址:http://kswsj.com/article/ggeiio.html

其他资讯



Copyright © 2009-2022 www.kswsj.com 成都快上网科技有限公司 版权所有 蜀ICP备19037934号