Since g:remoteFunction is deprecated what should I use instead? And please give an example.
you should use your own javascript AJAX functions, as they provide way more flexibility
EXAMPLE
used to be:
<input type="button" value="go!" onclick="${g.remoteFunction( controller:'my', action:'go', params:[..] )}"/>
should be (for example in JQuery
):
<g:javascript>
function go(){
$.ajax({
url:'${g.createLink( controller:'my', action:'go', params:[..] )}',
data:{ param1:param1 }
});
}
</g:javascript>
<input type="button" value="go!" onclick="go()"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With