My own solution to a somewhat similar Ajax situation, where I wanted to pass parms back to a callback function (though that's not possible as such) was to put the following line at the very bottom of the CF page that was sending its output to the call back function:

<cfoutput>~#.parmstring#</cfoutput>

Then in the callback function, I simply discard all output up to the tilde as shown below (in a situation where I could be sure no tildes would come back other than the one just above).

function MyCallback(parmstring){
     p=parmstring.indexOf('~');   // get rid of anything in the data stream up to what we're interested in
     parmstring = parmstring.substr(p+1)

You could of course include a wierder combination of characters, though 'tis true, there could be some situations where you could not be 100% certain you would never get  your wierd that string coming back in the output you want to get rid of.

Maybe that wouldn't work for you, though, I don't know...


-----Original Message-----
From: Jeff Howard <[EMAIL PROTECTED]>
Sent: Apr 23, 2008 2:38 PM
To: [email protected]
Subject: [ACFUG Discuss] Re: CFGRID CF8


Ok, after much looking I found an answer to the question in a Forta blog.
 
Many people in these threads are getting the error listed below:

window:global: Exception thrown and not caught (<url>, line 787)

The reason for this is because although you are calling a CFC, your are ultimately sending a full HTTP GET request to the server. In doing so, application.cfm/application.cfc is still being processed. If you are including ANY content via application.cfm/cfc, then your call via AJAX is actually returning the result of the CFC function as well as all content being included in your requests....

The workaround that Im using is to check the value of the CGI.SCRIPT_NAME and if it ends w/ cfc, DONT include any content... that way your CFC is only returing the data that you want returned.

Oh yeah... make sure its in JSON format (SerializeJSON)....

Happy coding :-)
# Posted By Jared | 12/18/07 4:04 PM

-------------------------------------------------------------
Annual Sponsor - Figleaf Software

To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by FusionLink
-------------------------------------------------------------
-------------------------------------------------------------
Annual Sponsor FigLeaf Software - http://www.figleaf.com

To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------

Reply via email to