I'm using the following code to read an XML file -\[code\]var xmlhttp;if (window.XMLHttpRequest){ // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest();}else{ // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { xmlDoc=xmlhttp.responseXML; tmp = xmlDoc.getElementsByTagName("to")[0].childNodes[0].nodeValue; alert ('-' + tmp + '-'); }}xmlhttp.open("GET", "test3.php", true);xmlhttp.send();\[/code\]
- XML File\[code\]<?xml version="1.0" encoding="ISO-8859-1"?><note><to>Tove</to><from>Jani</from></note>\[/code\]