I have the following, very simple CFC that I'm calling with jQuery. It works fine locally on CF9, but the client is on CF7, and there's no returnformat attribute in cffunction in CF7. How can I make this work? I tried using SerializeJSON() on the returned struct, but that didn't work. Thanks.
<cfsetting showdebugoutput="false">
<cffunction name="getPart" access="remote" returntype="any" returnformat="JSON">
<cfargument name="myarg" type="string" required="yes">
<cfset var ret = StructNew()>
<cfset ret.success = true>
<cftry>
<cfquery name="ret.part" datasource="dsn">
(query goes here)
</cfquery>
<cfset ret.recordcount = ret.part.recordcount>
<cfcatch type="any">
<cfset ret.success = false>
<cfset ret.error = cfcatch>
</cfcatch>
</cftry>
<cfreturn ret>
</cffunction>
Try using jsonencode and jsondeencode from CFLib.org