Just in order to tell in detail about the injectors, the data actually responds: {} is what sends information to it, therefore it may encounter parameters: [..]}:
<g:javascript>
function go(){
var javaScriptVariable='123'
$.ajax({
url:'${g.createLink( controller:'my', action:'go')}',
data:{
param1: "${params.params1}",
param2: javascriptVariable
}
});
}
</g:javascript>
data:{} data: $('form').serialize();, , .