jquery $.ajax - need help with json syntax

2010-04-29 Thread Tony Bentley
I need to pass 4 arguments and for this purpose, lets use a,b,c,d var data = {argumentCollection:{?}}; $.ajax({ url: cfc/mycfc.cfc?method=dbupdate, dataType: 'json', data: data, type: 'post', success:

RE: jquery $.ajax - need help with json syntax

2010-04-29 Thread Andy Matthews
-talk Subject: jquery $.ajax - need help with json syntax I need to pass 4 arguments and for this purpose, lets use a,b,c,d var data = {argumentCollection:{?}}; $.ajax({ url: cfc/mycfc.cfc?method=dbupdate, dataType: 'json', data: data

Re: jquery $.ajax - need help with json syntax

2010-04-29 Thread Scott Stewart
Tony, I think what your looking for is serialize. data:$(data).serialize(), On Thu, Apr 29, 2010 at 12:15 PM, Tony Bentley cascadefreehee...@gmail.com wrote: I need to pass 4 arguments and for this purpose, lets use a,b,c,d var data = {argumentCollection:{?}};        $.ajax({      

Re: jquery $.ajax - need help with json syntax

2010-04-29 Thread Tony Bentley
If I use serialize I get nothing passed as a post argument. I am requiring all args and I get the error as normal, ...required but not passed in. var dat = { 'OBJ': obj, 'VAL': val, 'ATTR': attr,

Re: jquery $.ajax - need help with json syntax

2010-04-29 Thread Tony Bentley
So then how would I reference an object with members? a.member, a.friend, etc. I tried a:a and 'a':a but neither works. I find that it's easier, and more self-documenting, to enumerate the variables in data directly: $.ajax({ url: cfc/mycfc.cfc?method=dbupdate,

Re: jquery $.ajax - need help with json syntax

2010-04-29 Thread Scott Stewart
one more shot, after a quick cursory look http://api.jquery.com/jQuery.post/ Check the bottom of the page, I *think* your answer is there.. gotta get back to the grind.. On Thu, Apr 29, 2010 at 12:54 PM, Tony Bentley cascadefreehee...@gmail.com wrote: So then how would I reference an object

Re: jquery $.ajax - need help with json syntax

2010-04-29 Thread Joel Watson
If dat is already an object literal (as below), why do you need to serialize it? Doesn't the the ajax() data take care of that for you if passing an object? If I use serialize I get nothing passed as a post argument. I am requiring all args and I get the error as normal, ...required but

Re: jquery $.ajax - need help with json syntax

2010-04-29 Thread Sean Coyne
So then how would I reference an object with members? a.member, a.friend, etc. I tried a:a and 'a':a but neither works. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of

Re: jquery $.ajax - need help with json syntax

2010-04-29 Thread Sean Coyne
So then how would I reference an object with members? a.member, a.friend, etc. I tried a:a and 'a':a but neither works. data: { a: { member: value, friend: value }, b: value, c: 2, d: true } ~| Want to reach the ColdFusion

RE: jquery $.ajax - need help with json syntax

2010-04-29 Thread Josh Nathanson
$.ajax - need help with json syntax If I use serialize I get nothing passed as a post argument. I am requiring all args and I get the error as normal, ...required but not passed in. var dat = { 'OBJ': obj, 'VAL': val

Re: jquery $.ajax - need help with json syntax

2010-04-29 Thread Tony Bentley
Okay I figured it out: var data = { 'a': {a:a.cat,b:a.dog,c:a.etc}, 'b': b, 'c': c, 'd': d }; Thanks everyone for the help. It helped me out quite a bit.

Re: jquery $.ajax - need help with json syntax

2010-04-29 Thread Scott Stewart
no problem :) On Thu, Apr 29, 2010 at 1:27 PM, Tony Bentley cascadefreehee...@gmail.com wrote: Okay I figured it out:        var data = {                'a': {a:a.cat,b:a.dog,c:a.etc},                'b': b,                'c': c,                'd': d        }; Thanks everyone for

RE: jquery $.ajax - need help with json syntax

2010-04-29 Thread Rick Faircloth
Ok...you lost me. Now, what exactly does the 'a': {a:a.cat,b:a.dog,c} do? An array for a ??? Rick -Original Message- From: Tony Bentley [mailto:cascadefreehee...@gmail.com] Sent: Thursday, April 29, 2010 1:27 PM To: cf-talk Subject: Re: jquery $.ajax - need help with json syntax

RE: jquery $.ajax - need help with json syntax

2010-04-29 Thread Andy Matthews
, April 29, 2010 2:43 PM To: cf-talk Subject: RE: jquery $.ajax - need help with json syntax Ok...you lost me. Now, what exactly does the 'a': {a:a.cat,b:a.dog,c} do? An array for a ??? Rick -Original Message- From: Tony Bentley [mailto:cascadefreehee...@gmail.com] Sent: Thursday, April 29

Re: jquery $.ajax - need help with json syntax

2010-04-29 Thread Matt Quackenbush
On Thu, Apr 29, 2010 at 2:43 PM, Rick Faircloth wrote: Now, what exactly does the 'a': {a:a.cat,b:a.dog,c} do? An array for a ??? No, that would be the equivalent to a ColdFusion struct. cfscript a = { a = a.cat, b = a.dog, c = }; /cfscript

Re: jquery $.ajax - need help with json syntax

2010-04-29 Thread Tony Bentley
Or better put, a json structure inside of a json structure :-) arguments.a = DeserializeJSON(arguments.a); This is then referenced as a ColdFusion structure with members ~| Want to reach the ColdFusion community with

RE: jquery $.ajax - need help with json syntax

2010-04-29 Thread Rick Faircloth
yeah, true...thanks, Matt! -Original Message- From: Matt Quackenbush [mailto:quackfu...@gmail.com] Sent: Thursday, April 29, 2010 4:32 PM To: cf-talk Subject: Re: jquery $.ajax - need help with json syntax On Thu, Apr 29, 2010 at 2:43 PM, Rick Faircloth wrote: Now, what exactly