ColdFusion 8
This is as simple pseudo-code as there can be:
<cffunction name="badJSON" access="remote" output="true" returntype="string" returnformat="JSON">
<cfreturn "06762" />
</cffunction>
Results in:
6762.0
It should result in:
06762
Is there a way to get JSON to not convert my value to numeric?
I know I can use WDDX, but that is out of the question.
Ok, so there is no real way to do this in CF8. The workaround is to add a character to the beginning or end of the string, and then handle it in the client side code. I’m working with USA ZIP Codes, so it was simply a matter of formatting each ZIP as ZIP+4 (00000-0000). That little dash in there makes it a string.