there is responseJSON as well, set your http header content type to
application/json and return the json string in the body of the request.
If you screw it up it will be undefined.
You should also use onSuccess instead of onComplete and you can check all
the standard xmlhttprequest response object properties such as status and
statusCode.
http://www.prototypejs.org/api/ajax/request

Gareth


On 11/30/07, hipska <[EMAIL PROTECTED]> wrote:
>
>
> Hi i'm using prototype for a project but i have some questions i can't
> find in the api docs.
>
> 1) if you make an ajax request, you get in the oncomplete function the
> response with transport.responseText ...
> Now i would like to know what other methods and vars there are in the
> transport object...
>
> Or can you only use .responseText??
>
>
> 2) i would like to make a response formatted in JSON instead of plain
> html, but i don't know how the request.php page must output the data
> then and i neighter know how i can get the response in JS as an
> object. (you understand me?)
> >
>

--~--~---------~--~----~------------~-------~--~----~
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