I have an query, which I want to convert to a JSON object.
Within my Query, there is a String (for example "0000"
or "0001"
). Unfortunately, after calling SerializeJSON
, the String is a number (0
, 1
, ...).
I get an error when calling the functions with jQuery because the JSON object isn't valid. The quotation marks are fail:
{
"COLUMNS": ["Test1","Test2","Test3"],
"DATA": [ ["AA ",0000,"testestest"] ]
}
I already tried so many things. Can you help me?
Here is my code:
<cffunction name="getData" access="remote" returntype="any" returnformat="JSON">
SQL....
<cfset result = SerializeJSON(result)>
<cfreturn result>
</cffunction>
This a ColdFusion 9 bug which had been registered in the Adobe ColdFusion (Bug ID 83638). You can upgrade your ColdFusion to ColdFusion 9.0.1 to resolve this issue. You need to just install the hot fix.
Visit the following URL for installing the hot fix.
http://helpx.adobe.com/coldfusion/kb/cumulative-hotfix-1-chf1-coldfusion.html
This fix is already added in ColdFusion 10.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With