Grow your CSS skills. Land your dream job.

jQuery parsing XML problem

  • # January 9, 2012 at 12:11 pm

    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)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".