 <p>Just to elaborate on Injecteers answer actually the data:{} is what is posting information to it so may clash with params:[..]} :</p> <pre><code>&lt;g:javascript&gt; function go(){ var javaScriptVariable='123' $.ajax({ url:'${g.createLink( controller:'my', action:'go')}', data:{ param1: "${params.params1}", param2: javascriptVariable } }); } &lt;/g:javascript&gt; </code></pre> <p><code>data:{}</code> can also be <code>data: $('form').serialize();</code> where serialize function grabs all the form elements and serializes it for you as params to be passed back. </p>