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().