If you want to you can always prepare and return a json object as a part 
of the X-JSON header of your server-side script.  Then, your onSuccess 
(or whatever) handler will get two parameters:  the XHR object and a 
JSON object which is the one that's created on the server.  That way, on 
the client side, you'll still just be working with a JSON object which 
you can use to fill the different portions of your page as necessary.

I'm not sure how you can set a page header in ColdFusion, so if that 
isn't something that you know how to do or if ColdFusion doesn't really 
do it, you can always just return the JSON object as a string and then 
eval() it on the client-side taking appropriate precautions when using 
the eval() function.

 -- Dash --

ScottW wrote:
> Hey gang -
>
> Yay, second day with Prototype. :D
>
> I finished up some other functions that I had initially built using
> mxAjax (ColdFusion-oriented bit) this morning, and started tackling
> the most involved mxAjax bit I'd done in this pile.
>
> I have a page that, upon load, lists out a row of info for each group
> of DB records it finds. One part of this info is a block of status
> info. I had coded up an mxAjax solution that would, on a set interval,
> pass in a list of IDs (one for each group of DB info) and the function
> would generate varying data and return it, and update the status info
> area for each item.
>
> The function would return new HTML for the status area (updating the
> wrapping div); a hex b/g color for that status info's div (color
> indicating varying status types); and another status variable (just a
> simple 0 or 1).
>
> I'm trying to puzzle out how to deal with this with Prototype. With
> mxAjax, I was able to return a simple CF structure with all the data,
> and then pull the data out (using some built-in mxAjax JSON
> functionality) and toss it in the appropriate areas.
>
> I figure I can't quite go the CF struct route, as Prototype is more
> generic (mxAjax actually uses Prototype for part of its functionality,
> heh). I'm guessing I'll need to pass all this stuff in via XML.
>
> So - any pointers in the right direction on this would be excellent.
> Again, keep in mind this is day 2 of Prototype development for me.
> Still getting my feet wet.
>
> Thanks!
> --Scott
>
>
> >
>
>   

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to