当通过cfajaxproxy发出呼叫到cffunction时,变量不被传递 [英] variable not being passed on when making a call through cfajaxproxy to a cffunction
问题描述
function getStateInfo(state){
alert(state);
var f = new funcs();
f.setCallbackHandler(updateFormFieldStateInfo);
f.setQueryFormat('column');
f.qry_getLenderEvictionStateInfo(<cfoutput>#request.Lender_Id#</cfoutput>,state);
}
不会将状态值传递给ColdFusion函数
doesn't pass the state value to the ColdFusion function
推荐答案
这里有几个可能有帮助的观察:
Here are a few observations that may help:
在你的先前的代码中定义,或者它与JavaScript的alert()函数混淆?我不相信 Coldfusion有< a>一个内置的alert()函数,除非它是在版本9中的新。
Is the alert() function defined in your prior code or is it being confused with javascript's alert() function? I don't believe that Coldfusion has a built in alert() function unless it's new in version 9.
注意,不是一个问题,var关键字必须定义在函数体,除非你使用Coldfusion 9.同样,new关键字是CF 9的新功能。我猜你是9版本,因为你使用这两个功能。
A caution, not a problem, the var keyword must be defined at the very top of the function body unless you are using Coldfusion 9. Likewise, the "new" keyword is new to CF 9. I'm guessing you're on version 9 since you're using both features.
对于Coldfusion 9:
For pre-Coldfusion 9:
function getStateInfo(state){
var f = createobject("component","functs");
alert(state);
...
不要将标签放在cfscript中。你不需要哈希标记,虽然他们不会造成伤害。
Don't put the tags within cfscript. You don't need the hash marks either, although they won't cause harm. Hash marks are intended for use outside of coldfusion tags (including cfscript), in the main body of the html.
此行:
f.qry_getLenderEvictionStateInfo(<cfoutput>#request.Lender_Id#</cfoutput>,state);
应为:
f.qry_getLenderEvictionStateInfo(request.Lender_Id,state);
这篇关于当通过cfajaxproxy发出呼叫到cffunction时,变量不被传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!