On Mon, Jul 2, 2012 at 8:21 AM, morchella <morchella.delici...@gmail.com> wrote:
>
> ok i am not getting it. this is what i have
> the cfc that uses JSONUtil to initialize results, but dont htink i am
> passing them back?
>

>    <cfset qry_Metric = #JSONUtil.serialize(qry_Metric)#><!--- This is
> serilizing in JSON? --->

(I changed my mind while I wrote this, so please read it all.)

Remember though - when you call a CFC in CF7, it will either be
encoded in WDDX by default. That's why I said you probably want to
call a CFM instead. The CFM calls your CFC, gets the result,
serializes it, and outputs the JSON.

My memory is a bit vague here, but if I remember right...

CF6 let you call CFCs via AJAX, but you ALWAYS got WDDX back.
CF7 let you get WDDX or use returnformat=plain to NOT do any
translation on the result.

So... actually - and I hope this isn't too confusing now. Your CFC
should return qry_Metric as defined above.

Your URL, the one you use in Ajax, should include returnformat=plain
to tell CF "Dude, don't do anything to my result." When your CFC
returns the string (JSON is a string), it should be left alone then.


-- 
===========================================================================
Raymond Camden, Adobe Developer Evangelist

Email : raymondcam...@gmail.com
Blog : www.raymondcamden.com
Twitter: cfjedimaster

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:351788
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to