SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    dealing with ajax returned text as xml

    i'm just missing something here. im following this:
    http://www-128.ibm.com/developerwork...wa-ajaxintro2/
    (and comparing it with a dozen other tutorials) but it (and all the other examples) only have the called page return plain text. i've modified my example to return some xml:
    Code:
    <client>
    <name>corey</name>
    <color>blue</color>
    </client>
    <client>
    <name>nick</name>
    <color>red</color>
    </client>
    upon returning this xml, how do i modify:
    Code:
    var result = http_request.responseText;
    to make javascript understand that "result" is xml so i can perform:
    Code:
    var clientList = result.getElementsByTagName("client");
    thanks!

    corey

  2. #2
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nevermind. i got it. changing:
    http_request.overrideMimeType('text/xml');
    and:
    var result = http_request.responseXML;

    did it.

    thx.

    corey


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •