Since g:remoteFunction in Grails 2.4.X is deprecated what should i use instead?

后端 未结 2 494
广开言路
广开言路 2020-12-21 01:16

Since g:remoteFunction is deprecated what should I use instead? And please give an example.

2条回答
  •  离开以前
    2020-12-21 01:19

    you should use your own javascript AJAX functions, as they provide way more flexibility

    EXAMPLE

    used to be:

    
    

    should be (for example in JQuery):

    
      function go(){
        $.ajax({ 
          url:'${g.createLink( controller:'my', action:'go', params:[..] )}',
          data:{ param1:param1 }
        });
      }
     
    
     
    

提交回复
热议问题