Oh, Charlie...you make me sad... Yeah, I get the server-side vs client-side...I was just hoping that somehow I would get to work with CF code back on the calling page.
Why don't you just figure out how we can query the JS data, like a QoQ or something and turn it back into CF data! I like it! Anyway...I'll live with the limitations...for now. But sooner or later we're going to have to set all this up properly! :o) Thanks for the help! Rick > -----Original Message----- > From: Charlie Griefer [mailto:[email protected]] > Sent: Wednesday, February 04, 2009 2:14 PM > To: cf-talk > Subject: Re: This CFC function and jQuery Ajax stuff is killing me... > > > no no no no no. > again.... CF = server side. JS = client side. > > if you pass JSON -to- the server -from- the client, you can use cfjson to > create coldfusion structures with it. Or, if you're on CF8, you can just > use the built-in deserializeJSON(). > > But (again)... if you've SENT data FROM coldfusion TO the client, you are > now on the client. At some point you're going to have to accept that there > is no client side ColdFusion. The "J" in AJAX is JavaScript. If you're > going to be working with AJAX, you're going to have to bite the bullet at > some point and roll up your sleeves and work with JavaScript. Or, yes, you > can use the built in AJAX functionality within CF. depending on what you > need to do it might be robust enough. But (IMO) the built in AJAX stuff, > while handy for quick one-offs, is not a replacement for really knowing and > understanding how to work with AJAX. > > On Wed, Feb 4, 2009 at 4:29 AM, Rick Faircloth > <[email protected]>wrote: > > > > > Thanks for the further tips, James...I'm sure it'll all > > come clear...(eventually :o) > > > > So, am I to understand, that after reading > > http://jehiah.com/projects/cfjson/ > > that CFJSON will translate my json-formatted > > javascript data returned from an ajax call into > > CF-formatted data, ready-to-use on my calling page > > without having to write js translation looping procedures, etc.? > > > > In essence, CFJSON was written to solve my problem of getting > > JSON-formatted data from a CFC back into CF-formatted data so > > I can use standard CF operations on it? > > > > Rick > > > > > > > -----Original Message----- > > > From: James Holmes [mailto:[email protected]] > > > Sent: Wednesday, February 04, 2009 12:58 AM > > > To: cf-talk > > > Subject: Re: This CFC function and jQuery Ajax stuff is killing me... > > > > > > > > > Try $.getJSON instead of $.ajax for a little more efficiency. > > > > > > cfajaxproxy is the JS way of getting to the same point, essentially. > > > With either method, you need to be able to write the JS you need to > > > use the result set. You're getting back an object with two properties: > > > COLUMNS and DATA. COLUMNS is an array; DATA is an array of arrays. So > > > yes, there's going to be some looping involved. > > > > > > mxAjax / CFAjax docs and other useful articles: > > > http://www.bifrost.com.au/blog/ > > > > > > > > > > > > 2009/2/4 Rick Faircloth <[email protected]>: > > > > > > > > The call that I've been using is > > > > > > > > $.ajax({ cache: false, > > > > type: "post", > > > > url: > > "../components/floor_duty.cfc?method="get_duty_schedule", > > > > dataType: "json", > > > > data: "formval", <--- form values, etc., are put into > > this variable > > > > success: function(response) { > > > > > > > > etc... > > > > > > > > and in the cfc method, I specify returnFormat = "json". > > > > > > > > I looked over the Adobe docs and another resource I found, > > > > but I've got to tell you, I couldn't figure out what to do > > > > with the information. > > > > > > > > Am I supposed to make use of "cfajaxproxy" tag or Spry or what? > > > > From looking at the example in the docs for using an asynchronous > > > > CFC proxy, it's quite complicated. Will I have to learn how > > > > to loop over the data from the ajax call using javascript to be > > > > able to use the data on my calling page? > > > > > > > > I hope there's a much simpler answer than what I'm suspecting. > > > > I was just hoping I'd be able to use the struct (structSchedule > > > > in my code) much like I would a cfquery. > > > > > > > > Rick > > > > > > > > > > > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:318877 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

