hi all, I want to make a ajax call to rails to particular action which returns xml and i want to get that xml in java script function.can any one help me to do this??? regards, senthil -- Posted via http://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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
senthil wrote:> hi all, > I want to make a ajax call to rails to particular action which > returns xml and i want to get that xml in java script function.can any > one help me to do this??? > > regards, > senthil >Which part do you need help with? Sending the results from Rails as XML? Reading/parsing the XML in JavaScript? -- Michael Wang --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
senthil wrote:> I want to make a ajax call to rails to particular action which > returns xml and i want to get that xml in java script function.can any > one help me to do this???Suppose your application.js has function foo(). I suspect this action handler does what you need: render :update do |rjs| rjs.call :foo, my_xml end That''s all. The my_xml contents will be escaped as a big JavaScript string, and ''foo('' & '')'' will be put around it. Then the whole string will go across the wire, and get evaluated as JavaScript. It will de-escape the string, find XML, and pass that to foo(). -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---