JSON and CF integration
Hi~
I am very new to JSON and AJAX. I am using a jQuery plugin to post a form via AJAX/JSON to a .cfm page, and am trying to send back a response that can be used by jQuery.
This is my jQuery bit:
$.ajax({
url: $(this).attr('action'),
data: $(this).serialize(),
type: $(this).attr('method'),
dataType: 'json',
success: function(data, status) {
var content = data.message;
this.set('content.text',content);
},
// Disable/Enable input elements
beforeSend: function() { inputs.attr('disabled', 'disabled'); },
complete: function() { inputs.removeAttr('disabled'); inputs[0].focus(); }
});
I can see that the request is going through successfully in Firebug (200 OK), but I have no idea how to manipulate the data on my CF page and then return it and use it in the code above. I know I can access the JSON data like this:
<cfset requestBody = toString(getHttpRequestData().content) />
But after that, I am totally lost! Is this even possible? Please let me know, thank you.
