Grow your CSS skills. Land your dream job.

Parsing XML with JavaScript: No value is returned

  • # January 26, 2013 at 12:36 pm

    Hey Guys!

    I’m working on a project where I need to load data via AJAX-Request. To do this I use a XML-File. Everything just works fine until I try to get the values of an “activity”.

    _THE XML-FILE_


    19
    2013-01-23
    Some text…
    Some text…
    1
    1


    1


    20
    19
    1
    3.0
    Some text…


    My approach was the following:

    var a_id = xmlDoc.getElementsByTagName(“activity”)[0].childNodes[0].nodeValue;

    But this returns nothing.

    Any idea how to “navigate” to “a_id”?

    # January 26, 2013 at 3:44 pm

    Could you make a [CodePen](http://codepen.io)? That might make it a bit easier to see what’s going on and try stuff out.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

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