dtkdrummer
2010-04-08 15:32:55 UTC
//loadXMLDoc function
function loadXMLDoc(dname) {
if (window.XMLHttpRequest) {
xhttp=new XMLHttpRequest();
}
else {
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET",dname,false);
xhttp.send("");
return xhttp.responseXML;
}
//load xml file
xmlDoc=loadXMLDoc("file://localhost/C:/MapTest/EMSData.xml");
x=xmlDoc.getElementsByTagName("Longitude")[0];
y=x.childNodes[0];
txt=y.nodeValue;
alert(txt);
This is just a test code, and it does not seem to want to load the xml file. The error I get is "Access denied". Am I passing the write path name? Do I need to format it differently? Eventually I want to put this on a site, but right now I'd just like to test it locally on my own comp....any help would be great.
Again the path I'm using is file://localhost/C:/MapTest/EMSData.xml