Dear All,
I would like to read XML data using Calculate in Javascript action in Script Button.
So that I can pull the data from XML into JS variables and use on my screen.
I have this code and it is working in general.
But not able to work it out in Personas.
Please guide.
var xhttp;
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
myFunction(xhttp);
}
};
xhttp.open("GET", "Data.xml", true);
xhttp.send();
function myFunction(xml) {
var x, i, xlen, txt, xmlDoc;
xmlDoc = xml.responseXML;
FirstName = xmlDoc.getElementsByTagName("FirstName")[0].childNodes[0].nodeValue;
}
--
Regards
Saurabha J