【发布时间】:2016-11-03 16:05:15
【问题描述】:
我想知道是否可以在我的 cfm 页面上调用 cffunction?我有onClick 按钮,应该调用同一页面上的cffunction。我也尝试将cfcomponent 放在我的函数周围,但我收到了这个错误:
Invalid CFML construct found on line 94 at column 1.
ColdFusion was looking at the following text:
<
The CFML compiler was processing:
< marks the beginning of a ColdFusion tag.Did you mean LT or LTE?
到目前为止,我有这个:
<cffunction name="getRecords" access="remote">
<script>
alert('test');
</script>
</cffunction>
这是我的 JS 函数:
function getRecs(){
try{
location.href = 'myCFMpage.cfm?method=getRecords';
}catch(err){
alert('Error')
}
}
我不确定这是否可能,我当前的代码没有在cffunction 中触发警报。我之所以尝试这样做是因为我在此页面上有一个cfquery,并且我想在用户单击按钮然后进行一些操作时从该查询中获取数据。如果有人可以告诉我这是否可能,或者有没有更好的方法来解决这个问题,请告诉我。
【问题讨论】:
-
这里有一些参考资料供您参考。 google.ca/#q=cold+fusion+component
标签: javascript coldfusion cffunction