This site is mobile accessible. Press the "Tap Here" button to use a different font-size.


Smartphone icons created by Freepik - Flaticon

The XMLHttpRequest Object

const xhttp = new XMLHttpRequest();
xhttp.onload = function() {
  const xmlDoc = this.responseXML;

// select the information in the file to display
  const x = xmlDoc.getElementsByTagName("ARTIST");
  let txt = "";
  for (let i = 0; i < x.length; i++) {
    txt = txt + x[i].childNodes[0].nodeValue + "<br>";
  }

// display the requested information
  document.getElementById("demo").innerHTML = txt;
};

// defines the XMLHttpRequestObject to get the information from
xhttp.open("GET", "cd_catalog.xml");
xhttp.send();