I have a function that returns a JSON string, and ColdFusion 10 returns a slightly different value than ColdFusion 8.
In CF10 I get
{"ZIPCODE":90210,"PHONE":"(555) 382-6630","LAT":83,"DISTANCE":74,"NAME":"Pueblo, CO","ADDRESS":"6830 Meddley Drive","LONG":104}
but in CF8 I get this
{\"DISTANCE\":74,\"LAT\":83,\"ZIPCODE\":90210,\"NAME\":\"Pueblo, CO\",\"PHONE\":\"(555) 382-6630\",\"ADDRESS\":\"6830 Medley Drive\",\"LONG\":104.}
For the function, my returnformat set to JSON and use serializeJSON() for the return value. I call the function via jQuery $.ajax with dataType set to JSON
CF8 backslashes cause javascript errors used to parse data. Why is this happening, and is there a workaround?
coldfusion coldfusion-8 coldfusion-10
RHPT
source share