JSON and CF integration
hi~
i new json , ajax. using jquery plugin post form via ajax/json .cfm page, , trying send response can used jquery.
this 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 request going through in firebug (200 ok), have no idea how manipulate data on cf page , return , use in code above. know can access json data this:
<cfset requestbody = tostring(gethttprequestdata().content) />
but after that, totally lost! possible? please let me know, thank you.
the ajax request hit coldfusion page in same way if did normal form submit, rather via ajax. of form data either in page's url scope (if form's method get) or page's form scope (if form's method post). fields should accessible either url.fieldname or form.fieldname.
as far manipulating data, totally depends on want accomplish it. you'll have provide lot more information assistance that.
with regard returning data, expecting have coldfusion page return?
-carl v.
message edited by: carl von stetten
More discussions in ColdFusion
adobe
Comments
Post a Comment