Thanks, Ray, for the info!

I was wanting to verify that I could call a method from the
query string. And it's good to know that I can include the
returnFormat specification, too.

Rick

> -----Original Message-----
> From: Raymond Camden [mailto:[email protected]]
> Sent: Sunday, January 11, 2009 10:44 PM
> To: cf-talk
> Subject: Re: Is it possible to reference a cfc method using ajax?
> 
> Don't forget that in CF8, you can convert a result to JSON over the
> wire. So if some CFC, let's call it, um, nose, had a method, pick,
> that returned an array, if you did an Ajax call to
> 
> nose.cfc?method=pick&returnFormat=json
> 
> The returnFormat argument will tell the CFC to JSON encode the result.
> So there is no need to write a "special" method for the Ajax call.
> 
> On Sun, Jan 11, 2009 at 4:44 PM, Rick Faircloth
> <[email protected]> wrote:
> > Thanks for the feedback, Judah...
> >
> > Rick
> >
> >> -----Original Message-----
> >> From: Judah McAuley [mailto:[email protected]]
> >> Sent: Sunday, January 11, 2009 3:26 PM
> >> To: cf-talk
> >> Subject: Re: Is it possible to reference a cfc method using ajax?
> >>
> >> An ajax call is just an http call. It should work with any url you can
> >> put in a browser. The important part is making sure that the request
> >> returns the data you want and in the format you want. That can be the
> >> tricky bit. The only gotcha I see there is that you are using a
> >> relative path call for your url, so you'll need to make sure that your
> >> ajax script thinks its in the place you think it is. I'd start doing a
> >> fully qualified url so that you don't run into any issues there.
> >>
> >> Judah
> >>
> >> On Sun, Jan 11, 2009 at 11:52 AM, Rick Faircloth
> >> <[email protected]> wrote:
> >> > Hi, all...good Sunday to ya.
> >> >
> >> > I was wondering if it's possible for me to reference
> >> > methods of a cfc in ajax code, e.g.
> >> >
> >> > $.ajax({        cache: false,
> >> >             type: "POST",
> >> >             url:  "components/virtual_tours.cfc?method=getAllTours",
> >> >             dataType: "json",
> >> >             data: formval,
> >> >             success: function(response){
> >> >
> >> > Or something like that...
> >> >
> >> > ???
> >> >
> >> > 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:317748
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to