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

Discussion in 'Javascript' started by Nicole.Winfrey@gmail.com, Nov 20, 2007.

  1. Guest

    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);
    , Nov 20, 2007
    #1
    1. Advertising

  2. wrote:

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


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Nov 20, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Damon Payne
    Replies:
    0
    Views:
    9,137
    Damon Payne
    Mar 8, 2005
  2. Robert Rotstein
    Replies:
    0
    Views:
    2,800
    Robert Rotstein
    Dec 21, 2005
  3. Stanimir Stamenkov
    Replies:
    2
    Views:
    734
    Stanimir Stamenkov
    Oct 25, 2005
  4. Jesús Bosch
    Replies:
    1
    Views:
    13,061
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jul 3, 2006
  5. Søren M. Olesen
    Replies:
    4
    Views:
    531
    Dan Rogers
    Feb 15, 2005
Loading...

Share This Page