JavaScript snippet to read and output XML file on page load?
- by Banderdash
Hey guys, hoping I might get some help. Have XML file here of a list of books each with unique id and numeral value for whether they are checked out or not. I need a JavaScript snippet that requests the XML file after the page loads and displays the content of the XML file.
XML file looks like this:
<?xml version="1.0" encoding="UTF-8" ?>
<response>
<library name="My Library">
<book id="1" checked-out="1">
<authors>
<author>John Resig</author>
</authors>
<title>Pro JavaScript Techniques (Pro)</title>
<isbn-10>1590597273</isbn-10>
</book>
<book id="2" checked-out="0">
<authors>
<author>Erich Gamma</author>
<author>Richard Helm</author>
<author>Ralph Johnson</author>
<author>John M. Vlissides</author>
</authors>
<title>Design Patterns: Elements of Reusable Object-Oriented Software</title>
<isbn-10>0201633612</isbn-10>
</book>
...
</library>
</response>
Would LOVE any and all help!