Using JavaScript to call a
servlet via POST and sending along various parameters.
Servlet returns an XML message.
In the same page, XML result is parsed and written into a table.
I want to include a "Download Results" type button or link below the table that will allow the user to download the results (in XML, or a comma delimited file).
My plan was to make another XMLHttp call to another servlet and pass the servlet the same XML response my JS received. Problem is, my JS seems to have "trapped" the XML results - what I'd like is a download prompt (i.e. "Save As...") instead.
Any way to do this?
Or do I need to rewrite the XML results into a hidden form and then submit the form to the servlet?
FWIW, the XML isn't anything too fancy, but I am unfamiliar with how to pass the XML back to the servlet via a form...