I have a function that essentially does this
<cffunction name="foo" access="remote" returnformat="JSON" >
<cfreturn ["000", "001", "002"]>
<cffunction>
I am retrieving this array using jQuery.ajax
, In firebug I see [000, "001", "002"]
.
See how the zeros are missing their quotations. This is causing a jQuery to through a parsing error, SyntaxError: JSON.parse: expected ',' or ']' after array element
, or that's what I am assuming. Can anyone explain why ColdFusion isn't putting quotations around the zeros, and a way to fix it?
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