Render xmlhttp response in new window with text/xml content type

N

Nicole.Winfrey

Hi,

At the moment, I'm displaying the XML HTTP response text using
javascript alert (see below).
I'm trying to render XML HTTP response in a new window and the output
of the window needs to be of content type text/xml (i.e. the XML
output where you can expand/contact the tags in browser).
Is there anyway to render the XML? Thanks....

// Post XML via AJAX.
xmlhttp.open("POST", "http://localhost/processRequest", true);
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4)
{
alert(xmlhttp.responseText);
}
}
xmlhttp.setRequestHeader("Content-Type", "text/xml")
xmlhttp.send(xmlRequest);
 
M

Martin Honnen

At the moment, I'm displaying the XML HTTP response text using
javascript alert (see below).
I'm trying to render XML HTTP response in a new window and the output
of the window needs to be of content type text/xml (i.e. the XML
output where you can expand/contact the tags in browser).
Is there anyway to render the XML? Thanks....

// Post XML via AJAX.
xmlhttp.open("POST", "http://localhost/processRequest", true);
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4)
{
alert(xmlhttp.responseText);

With Mozilla you should be able to do
window.open('data:text/xml,' + xmlhttp.responseText)
but IE does not support data URLs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top