I think that before the v5 version of Google Chrome, the code below worked. Now in the latest version, I get the following error when opening my web page locally:
"XMLHttpRequest cannot load the file: /// C: /Temp/Course.xml. Cross-start requests are only supported for HTTP."
Javascript Code:
function getXmlDocument(sFile) {
var xmlHttp, oXML;
try {
xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", sFile, false);
xmlHttp.send(null);
oXML = xmlHttp.responseXML;
} catch(e) {
xmlHttp = getXMLObject();
xmlHttp.async = false;
xmlHttp.resolveExternals = false;
xmlHttp.load(sFile);
oXML = xmlHttp;
}
return oXML;
}
function getXMLObject() {
var aVersions = new Array("Msxml2.DOMDocument.6.0", "Msxml2.DOMDocument.3.0");
for (var i=0; i<aVersions.length; i++) {
try {
var oXML = new ActiveXObject(aVersions[i]);
return oXML;
}
catch(e) {
}
}
return null;
}
I really do not want you to open a web page from a web server each time.
source
share