XML file
<?xml version="1.0" encoding="UTF-8"?>
<checkers>
<data>0</data>
<text>Blank Checker/White square</text>
</checkers>
<checkers>
<data>3</data>
<text>black square blank></text>
</checkers>
<checkers>
<data>0</data>
<text>Blank Checker/White square</text>
</checkers>
All I aim to achieve is extracting the data and creating an array/list like this:
[0,3,0] from the XML file through HTTPrequest for use in my JavaScript code.
If you can guide me in the right direction or share some resources for learning on this topic, it would be greatly appreciated. Thank you.
function loadXMLDoc() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
this.responseText;
}
};
xhttp.open("GET", "data.xml", true);
xhttp.send();
console.log(xhttp)
var grid = [0,3,0]
Desired final outcome required