Skip to main content
Participant
January 27, 2009
Question

cfajaxproxy hangs

  • January 27, 2009
  • 2 replies
  • 341 views
I'm having trouble getting cfajaxproxy to return the result from my function. I can call the function and get a response when I use <cfinvoke>, but when I use cfajaxproxy the function hangs at the <cfreturn> statement. Here's my function code:

<cffunction
name="hoser"
access="remote"
returntype="string">
<cfset myReturnFoo = "foo">
<!--- code hangs here when called by cfajaxproxy--->
<cfreturn myReturnFoo>
</cffunction>

And here's how I'm calling it:
<cfajaxproxy cfc="idiot" jsclassname="idiot_proxy" />


function getHoser() {
var instance = new idiot_proxy();
instance.setErrorHandler(getHoserFailure);
instance.setCallbackHandler(getHoserSuccess);
instance.hoser();
}

function getHoserSuccess(result) {
alert("In getHoserSuccess");
alert(result);
}

function init() {
getHoser();
}

Any help would be greatly appreciated.
This topic has been closed for replies.

2 replies

budzilla1Author
Participant
January 29, 2009
Thanks Azadi. Unfortunately, none of your suggestions bore fruit. I do have the failure handler script defined, but just didn't post it. I had my web server admin enable Ajax debugging, but I don't see any pop-up window that gives me any error messages. I'm using firebug, and the only message I get is "Remote CFC timed out while waiting to execute."

The strange thing is that I had some fairly intensive data exchanges working two weeks ago when I last looked at it. Now, I can't even pass a string back. :(
Inspiring
January 28, 2009
1) when using cf ajax features, one must declare in-page js functions as
functionName = function() {
...
}
and NOT as
function functionName() {
...
}

2) you MUST have getHoserFailure js function defined in your script - do
you have it and just didn't post it?

3) in cf admin, enable ajax debugger, then add ?cfdebug to your URL to
see the pop-up ajax debugger window - it may very well give you more
info about any errors occurring with your cfajaxproxy.

4) VAR you variables inside cfc functions! use <cfset var MyReturnFoo =
"foo">. but in a simple test function like yours you do not even need to
set the variable - you can just do <cfreturn "foo">



Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/