On Jun 8, 3:00 pm, Ralph Shnelvar <[email protected]> wrote:
> Could someone please demonstrate the code to send both json (or xml) AND
> javascript (to be executed) in a single Ajax request?
>

Assuming you mean sending that as the response to an ajax request ....

If you set the X-JSON header to be a json fragment Prototype (don't
know about other libraries) will deserialize that for you, and then
the response body can be whatever you want.

Personally if I've already written stuff to take a JSON response and
do stuff based on that data, I wouldn't want to also send back
javascript fragments - I'd just write the client side code to do the
desired action if the appropriate content was in the response JSON

Fred
> Is this even possible?
> --
> Posted viahttp://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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-talk?hl=en.

Reply via email to