I use this script in order to read from an xml file and post it to a asp.net page:
<script type="text/javascript">
var doc = "Instructions.xml";
var path = "/pages/Support/Word/";
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET", path + doc, false);
xmlhttp.send();
xmlDoc = xmlhttp.responseXML;
document.getElementById("head").innerHTML =
xmlDoc.getElementsByTagName("row")[0].childNodes[0].nodeValue;
document.getElementById("text").innerHTML +=
xmlDoc.getElementsByTagName("line")[0].childNodes[0].nodeValue
</script>
This script works fine in Google Chrome browser, and Safari; but in IE7 and Mozilla simply doesn't work... just like that.
Does someone know why this happens and give a great assistance?
ADDITIONAL UPDATE
Well I tried many times also looking on debugger i saw only one problem comes up.
When the program comes to line
document.getElementById("head").innerHTML = xmlDoc.getElementsByTagName("text")[0].childNodes[0].nodeValue;
then throw me an error of JavaScript runtime error: Unable to get property 'childNodes' of undefined or null reference
If that will helps