我的 GSP 文件中的 javaScript 函数中有一个 remoteFunction 调用:
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)')};
}
当我检查页面源时,远程函数会创建以下代码:
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){} } });;
为什么我的变量被替换为“null”?
谢谢!