Hey all,
Here's an XML snippet:
<appSettings>
<add key="val1" value="val2"/>
The XML document is loaded in memory, ready to be parsed.
How would you get and write the value of "val2" to the web page?
Thanks, rodchar
Post Comments:
I'm getting .selectSingleNode is not a function:
<script type="text/javascript">
if (window.XMLHttpRequest)
{
xhttp=new window.XMLHttpRequest()
}
else
{
xhttp=new ActiveXObject("Microsoft.XMLHTTP")
}
xhttp.open("GET","test.xml",false);
xhttp.send("");
xmlDoc=xhttp.responseXML;
var node = xmlDoc.selectSingleNode("/appSettings/add[@key='Key']");
alert(node.getAttribute("value"));
</script>