Doh! Yes, exactly what I'm doing. Here's the weird thing though -
works fine in CF9. Perfect. In CF8 it simply escapes all the quotes in
the JSON string itself. Strange behavior? Or just an incompatibility?

I honestly didn't understand that returnformat=json was actually
serializing the json. I thought it was killing the wddx formatting.

Thanks for the education!

Cheers,
Kris



On Thu, Dec 30, 2010 at 9:37 PM, Raymond Camden <rcam...@gmail.com> wrote:
>
> Dumb question. But you are doing something like this:
>
> <cfreturn serializejson(data)>
>
> but _also_ adding returnFormat=json?
>
> If so - you are double serializing the JSON.
>
>
> On Thu, Dec 30, 2010 at 8:09 PM, Kris Jones <kris.jon...@verizon.net> wrote:
>>
>> Okay, finally figured this out: To make this work in CF8 (w/ chf4
>> applied), I had to change the returnformat to "plain", rather than
>> "json". Otherwise it escaped all the quotes used to construct the
>> JSON. This does not happen in CF9.
>>
>> Searched and searched for this on the web to no avail - hopefully this
>> will save someone else some time.
>>
>> Cheers,
>> Kris
>>
>>
>>> Was reworking a function today to use serializejson instead of
>>> building the json myself. Love this functionality. Unfortunately, I've
>>> run into a snag when I pushed this over to a CF8 box where it must
>>> run. The double-quotes on elements in the JSON returned are escaped
>>> when run from the CF8 box, but are not escaped (the desired format)
>>> when run from CF9.
>>>
>>> I checked hotfixes, and updated the CF8 box to chf4, which includes
>>> the functionality for returnformat=json.
>>>
>>> CF9 Format:
>>>
>>> {"COLUMNS":["CREATE_DT","ID","CMS_ID","NAME"],"DATA":[["December, 30
>>> 2010 19:16:31",32,"KJ301220101413",null],["December, 30 2010
>>> 18:33:45",31,"KJ301220101413",null]]}
>>>
>>> CF8 Format:
>>>
>>> "{\"COLUMNS\":[\"CREATE_DT\",\"ID\",\"CMS_ID\",\"NAME\"],\"DATA\":[[\"December,
>>> 30 2010 19:16:31\",32,\"KJ301220101413\",null],[\"December, 30 2010
>>> 18:33:45\",31,\"KJ301220101413\",null]]}"
>>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:340330
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to