I find that it's easier, and more self-documenting, to enumerate the
variables in data directly:
$.ajax({
url: cfc/mycfc.cfc?method=dbupdate,
dataType: 'json',
data: {
a: 'andy',
b: 'bobby',
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({
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,
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,
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
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
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
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
$.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
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.
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
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
, 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
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
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
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
16 matches
Mail list logo