Wow, well, I wouldnt normally recommend outputting directly like that - but if it solves your problem, more the better. Boy am I glad returnFormat was added to CF8.
On 7/4/07, Andrew Scott <[EMAIL PROTECTED]> wrote: > Ray, > > I use CFC's all the time with Json, the trick is not to use the cfreturn tag > under cfmx7 and below but to output it instead. > > Have a look at how I do it with http://CFJsonService.riaforge.org and you > see what I mean. > > > > Andrew Scott > Senior Coldfusion Developer > Aegeon Pty. Ltd. > www.aegeon.com.au > Phone:+613 8676 4223 > Mobile: 0404 998 273 > > > > -----Original Message----- > From: Raymond Camden [mailto:[EMAIL PROTECTED] > Sent: Thursday, 5 July 2007 12:41 PM > To: CF-Talk > Subject: Re: having trouble with CFJSON / Spry > > So two people say its the META tag, and I'm sure that's right, but no > one else also thinks he has an issue with the WDDX-ifying as well? > > On 7/4/07, Dan G. Switzer, II <[EMAIL PROTECTED]> wrote: > > Yes, the Dev Net tag breaks things. The easiest solution is to just stop > > using the Dev Net edition and go to the Developer Edition. > > > > The Dev Net Edition has unlimited IPs, but places the meta tag in each > > request automatically. > > > > The Developer Edition is limited to a single visiting IP address. > > > > They both are essentially the same as the Enterprise version with their > own > > restrictions. > > > > -Dan > > > > >-----Original Message----- > > >From: Raymond Camden [mailto:[EMAIL PROTECTED] > > >Sent: Wednesday, July 04, 2007 10:18 PM > > >To: CF-Talk > > >Subject: Re: having trouble with CFJSON / Spry > > > > > >Could be two things here. First - yes - that meta tag could most > > >likely be breaking stuff. I don't know as I run a non-dev edition > > >locally. > > > > > >Secondly - and this is what concerns me the most - do not forget CFCs > > >return data in XML. Either WDDX form or plain XML. > > > > > >So even though you returned JSON, it was turned into XML. Not > > >translated, wrapped I should say. You would need to point Spry to a > > >CFM page instead. > > > > > >FYI, CF8 fixes this by letting you specify a return format for CFC > methods. > > > > > >On 7/4/07, Jonathon Stierman <[EMAIL PROTECTED]> wrote: > > >> I've got a webservice running that converts some various CF objects > into > > >> JSON - Seems to be working alright, but I'm running into a vexing > issue. > > >> When I call the service via Spry, I get an error from SpryDebug.js: > > >> > > >> "Caught exception in JSONDataSet.loadDataIntoDataSet: SyntaxError: > > >missing } > > >> in XML expression" > > >> > > >> What's confusing is that if I call the service myself, copy the > contents > > >> into a .js file, and then have Spry call straight from that .js file, > it > > >> works just fine! Here's the JSON my Service returns, if that helps: > > >> > > >> { > > >> "recordcount":3, > > >> "columnlist":"categoryid,matchid,name", > > >> "data": > > >> { > > >> "categoryid":[3,3,3], > > >> "matchid":[1,2,3], > > >> "name":["some dude","random guy","joe schmoe"] > > >> } > > >> } > > >> > > >> My service code (condensed) is pretty basic. I pass in a Query object > > >> (results) and tell CFJSON to format it as a query: > > >> > > >> <!--- transform the result into JSON ---> > > >> <cfset results = Variables.jsonCFC.encode( > > >> data = results, > > >> queryFormat = "query" > > >> ) > > >> /> > > >> <cfreturn results /> > > >> > > >> I am running on a development server, so I get that meta data on every > CF > > >> request: > > >> > > >> <META NAME="ColdFusionMXEdition" CONTENT="ColdFusion DevNet Edition - > Not > > >> for Production Use."> > > >> > > >> Could that be the culprit? If so, how do you guys develop AJAX apps > > >without > > >> running into this issue? > > >> > > >> Jonathon > > >> > > >> > > >> > > >> > > > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion MX7 by AdobeĀ® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:283036 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

