Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jQuery parsing XML problem

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #36035
    XaviJr
    Participant

    I’m using javascript to get my xml file from the server.

    I get all the file text if I write this:


    if (req.readyState == 4) {
    if (req.status == 200) {
    alert(req.responseText);
    }
    }

    I get “[object XMLDocument]” if I write this:


    if (req.readyState == 4) {
    if (req.status == 200) {
    alert(req.responseXML);
    }
    }

    But than it does nothing if I try this:


    if (req.readyState == 4) {
    if (req.status == 200) {
    alert(req.responseXML.find("Hello"));
    }
    }

    Hello it’s the tag I’m trying to find.

    Any idea why is jQuery not finding my tag? How can I print all the xml file when I have XMLDocument Object (to see if it’s empty).

    Thanks in advance

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.