AJAX unable to get value of the property childNodes

statsCitBobby

New Member
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\]
If the XML file is called xxxx.PHP or anything other than xxxx.XML I get the error "unable to get value of the property childNodes". If the XML file is called xxxx.XML it works fine. Files are exactly the same, the only difference is the extension.This has been tested in FF, Chrome and IE with the same results. It's not a cache issue.I need the extension to be PHP so I can generate dynamic content for AJAX.Could this be something to do with php.ini / apache.conf or is there something I'm missing ??
 
Back
Top