you can hit the cfc directly just fine and you did the right thing by setting
the returntype in the call instead of in the cfc so you can reuse the cfc
without returning just json.
Are you sending a form or hard coded info?
BTW~ jquery doesn't handle json very much, they have a getJson tag which is
useless if you want to gather info back from an ajax call since it asks for the
file.
if you are sending a form then serialize it and it gathers the fields and sends
it which will be a struct the same as a reg form
$.ajax({
type: 'post',
url: '/cfc/users.cfc?method=addUser&returnFormat=json',
data: $("form").serialize(),
or with vars
var password = $('input[name=password]');
var password2 = $('input[name=password2]');
var data = 'password=' + password.val() + '&password2=' +
password2.val()
$.ajax({
url:
"/admin/cfc/system.cfc?method=checkPassword&returnFormat=plain",
type: "post",
data: data,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325381
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4