Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8581

Access XML file from Personas 2.0

$
0
0

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


Viewing all articles
Browse latest Browse all 8581

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>