can't find mxAjax component?

4 views
Skip to first unread message

Plange

unread,
Jun 12, 2008, 5:41:42 PM6/12/08
to mxAjax
I just setup mxAjax and I thought I did it right-- I just want to use
it to do some asynchronous calculations using CF but not having much
luck. The form is here:

http://ah.triggerid.com/useful/index.cfm

and I have the form set to trigger the function after filling out the
3rd field. Here's the JS:

<script type='text/javascript' src='http://ah.triggerid.com/includes/
core/js/prototype.js'></script>
<script type='text/javascript' src='http://ah.triggerid.com/includes/
core/js/mxAjax.js'></script>
<script type='text/javascript' src='http://ah.triggerid.com/includes/
core/js/mxData.js'></script>
<script language="javascript">
var url = "http://ah.triggerid.com/includes/core/cf/functions.cfc";
function doMortg() {
var P=document.getElementById('P').value;
var I=document.getElementById('I').value;
var N=document.getElementById('N').value;
alert(P);
params = 'P='+P+',I='+I+',N='+N;
alert(params);
new mxAjax.Data({
executeOnLoad:true,
paramArgs: new mxAjax.Param(url,{param:params,
cffunction:"mortgagecalc"}),
postFunction: handleData
});
}
function handleData(response) {
document.getElementById('test').innerHTML =
response;
}
</script>

and right now my functions.cfc file just has this:

<cfcomponent extends="mxAjax">
<cffunction name="mortgagecalc">
<cfargument name="P" required="yes" type="string">
<cfargument name="I" required="yes" type="string">
<cfargument name="N" required="yes" type="string">
<cfset retData="hello">
<cfreturn retData>
</cffunction>

</cfcomponent>

If I use it it says it can't find the component mxajax?

James Holmes

unread,
Jun 12, 2008, 9:07:14 PM6/12/08
to mxa...@googlegroups.com
Where is mxajax.cfc in relation to your functions.cfc file? Your code
expects it to be either directly in the same folder or in the web
root.

--
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/

Reply all
Reply to author
Forward
0 new messages