Just make sure that your server returns data with one of the following
content-types: application/ecmascript, application/javascript,
application/x-ecmascript, application/x-javascript, text/ecmascript,
text/javascript, text/x-ecmascript, or text/x-javascript
as explained in the API: http://www.prototypejs.org/api/ajax/options

Gabriel Gilini

www.usosim.com.br
gabr...@usosim.com.br
gabr...@souagil.com.br


On Wed, Jan 28, 2009 at 12:34 PM, Richard Quadling <rquadl...@googlemail.com
> wrote:

>
> Hi.
>
> Currently I use AJAX to send POST requests and receive JSON encoded
> data which is magically supplied as an object to me by Prototype in
> the onSuccess handler.
>
> I can then examine the data and process it as I need to.
>
> So far so good.
>
> I now need to do something I don't know how to do.
>
> The "processing" I mentioned above is essentially a switch statement
> which determines the processing I want. The specific case then
> extracts the parameters from the JSON object and calls the appropriate
> method/function with the extracted params. More functionality means
> more editing of this 1 function.
>
> What I want to achieve is a way to have my server supply the call that
> is to be made and when the response arrives at the client, it is just
> executed, without me having to decode it first.
>
> I want to have a shrink wrapped set of classes which are communicated
> with, essentially by the server.
>
> A simplistic example.
>
> Client performs some user interface action (clicks a button, drop down,
> etc.).
> This initiates an AJAX call to get some data.
> The server responds with the data using JSON.
> The onSuccess handler decodes the data client side and calls the
> appropriate functions to handle the response.
>
> I want this to become
>
> Client performs some user interface action (clicks a button, drop down,
> etc.).
> This initiates an AJAX call to get some data.
> The server responds with the data using JSON and the code required to
> handle the data.
> The onSuccess handler just runs the code.
>
> This will allow me to incrementally add functionality to the client as
> they move around the site.
>
> Regards,
>
> Richard Quadling.
>
>
>
>
>
> --
> -----
> Richard Quadling
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> "Standing on the shoulders of some very clever giants!"
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to