0

ajaxCFC issue

ColdFusion
Hey Everyone,
I have a pretty damn simple AJAX call on a new web site I'm setting up but it's not working. I get the dreaded "Invalid Reply from Server" message. According to Firebug the result I'm getting from AJAX call is blank. I have no idea where the  problem is. Based on setting up test queries I know that the CFC in question  long with ajax.cfc are both getting called however the function in question,  getEvents does not get gett called. Below is my code.

Code loading the AJAX and JS files

JS Code calling the CFC

CFC Function trying to return a single event

This is the part where I'm thinking I might have an issue. These are
the onRequest, onRequestStart and onRequestEnd Functions

I remember reading something on Rob's blog about onRequest interupting
AJAX calls, but his solution, setAbortAfterRequest(true); in the
AJAX.cfc file did not have any effect on this issue.

Any thoughts? Am I missing something simple?

Good Day!
Ryan
tags:
ColdFusion
Todd Sharp said:
 
onRequestEnd and onRequest will both break AJAX calls. Comment them out and see what happens.
 
posted 869 days ago
Add Comment Reply to: this comment OR this thread
 
 
Todd,
Thanks for the comment, I actually did try that and your right it is the onRequest function. If I comment it out the ajax call works perfectly.
 
posted 869 days ago
Add Comment Reply to: this comment OR this thread
 
Christiano said:
 
 
posted 869 days ago
Add Comment Reply to: this comment OR this thread
 
 
Christiano, that is the post. Thanks for the URL.
 
posted 869 days ago
Add Comment Reply to: this comment OR this thread
 
Rob Gonda said:
 
Having an onRequest method in your Application.cfc is known to break
Web Services, Flash Remoting, and Ajax Calls. It affects and but is
not limited to AjaxCFC. There's a workaround that requires you to add
some code to your onRequestStart method, checking if the call is
targetting a CFC and removing the onRequest method dynamically. (check
if the file ends with a cfc and run structDelete(this,'onRequest').
This will only deleted it for the current request.

HTH
 
posted 868 days ago
Add Comment Reply to: this comment OR this thread
 
Rob Gonda said:
 
Ryan, could you fix the problem? Did the trick work?
 
posted 849 days ago
Add Comment Reply to: this comment OR this thread
 
 
Rob,
I apologize I totally missed your reply on 7-7, I will test it out tonight and let you know!
 
posted 849 days ago
Add Comment Reply to: this comment OR this thread
 
wow gold said:
 
 
posted 209 days ago
Add Comment Reply to: this comment OR this thread
 

Search