Bear in mind that jQuery doesn't expect a particular format, you have the ability to retreive any JSON object and do something with it. That being said most JSON services return a collection of key/value pairs, a serialized CFQUERY resultset is a little different. A query object contains a COLUMNS and DATA property. In the case of the DATA property each item is an array with one item per field. The COLUMNS property contains an array of column names.
You should also set the HTTP header of the loaddata.cfm page to identify the contents as JSON, you can add the following just before the CFOUTPUT tag on that page:
<cfcontent type="application/json" reset="yes">
//build HTML text to be displayed
var txt = "<ul>";
//the DATA property will contain one array for each row in your result set
for(var i = 0; i < data.DATA.length; i++)
txt = txt + "<li>" + data.DATA[i] + "</li>"; //add the second item in the array, to the string to be output
txt = txt + "</ul>";
$("#div1").append(txt); //add the new HTML block to the DOM.
I recommend that you take a look at:
Ray Camden's blog, which contains many jQuery related articles:
The tutorials section of the jQuery site:
That's a great help Bob, I appreciate you taking the time to write that. This sent the data correctly, so I'm able to move forward.
I did take a look at those links before you had sent them, they pop up pretty high when searching on CF and jQuery. I just found another tutorial I thought was better. I'll take a deeper look. Thanks again.