javascript - grails remotefunction: can't access params -
i've got remotefunction call in javascript function in gsp file:
function fncreateentitiesperforcechart() { var interval = $("#entitiesperforcetimeintervalselect").val(); interval = escape(interval); var url = '${createlink(controller: 'federation', action: 'createentitiesperforcechart')}?interval='+interval; $("#entitiesperforcechart").attr("src", url); alert("interval is: " + interval); ${remotefunction(controller: 'federation', action: 'getentitiesperforcetable', params: '\'interval\''+':'+interval, onsuccess: 'fnupdateentitiesperforcetable(data,textstatus)')}; }
when check page source, remotefunction creates code:
try{dojograilsspinner.show();}catch(e){} dojo.xhr('get',{content:{'interval':null}, preventcache:true, url:'/federationreporter/federation/getentitiesperforcetable', load:function(response){ fnupdateentitiesperforcetable(data,textstatus); }, handle:function(response,ioargs){try{dojograilsspinner.hide();}catch(e){} }, error:function(error,ioargs){try{dojograilsspinner.hide();}catch(e){} } });;
why variable being replaced 'null'?
thanks!
try params
in remotefunction
call
params: '\'interval\': + interval'