Grails Resources Plugin and AJAX loaded javascript

前端 未结 3 803
梦如初夏
梦如初夏 2021-02-05 10:52

I added the resources plug-in in a grails 1.3.7 application and everything works fine except javascript that is loaded asynchronously.

So if I have a template that conta

3条回答
  •  Happy的楠姐
    2021-02-05 11:41

    I always go with Peter Ledbrook response, but instead of using a layout, I use a template and I automate what to render in the main layout. My main.gsp looks like the following:

    
    
        
    
    
        
       ...  
       

    Then, the _content.gsp template looks like:

    
    
    
    

    That way, I can automatically ajaxify all relative links and forms and no action is required in the controller (no different responses), since the ajax response always goes inside the content div.

提交回复
热议问题