I\'m trying to understand how to use JSONutil to serialize/deserialize JSON between jquery and coldfusion. I am stuck with coldfusion 7 so I can\'t use the returnform
(Brief side note, my advice is get the cfc working separately first. It is much easier to debug CF problems that way. Do not add jquery to the mix until you have confirmed the cfc returns the desired JSON string. But back to your question ...)
The utility is easy to use. Inside your function, create an instance of it. Then pass your query object into serializeJSON(). Finally return the resulting string.
Note, your function signature must support remote access and return a string (not a query)
.... run cfquery .....
You can test the cfc directly in your browser (or with cfinvoke):
http://localhost/path/to/client.cfc?method=getClientsByName&name=foo
However, the native representation of queries is a bit awkward IMO. As Lance mentioned, you may prefer to return an array of structures instead, which is a more standard.
... run query ...