Attempting to load a local XML/XSL file into a variable for editing seems to be causing an issue. The code provided functions properly in IE and Chrome, however, Chrome displays a warning due to the synchronous nature of the call.
function loadXMLDoc(fileName){
if (window.ActiveXObject){
xhttp = new ActiveXObject("Msxml2.XMLHTTP");
} else {
xhttp = new XMLHttpRequest();
}
xhttp.open("GET", fileName, false); // false is synchronous
xhttp.send();
var xml = xhttp.responseXML;
return xml;
}
When attempting to make the call asynchronous by changing it to:
xhttp.open("GET", fileName, true);
or keeping the default:
xhttp.open("GET", fileName);
the functionality breaks in Chrome and throws an error in the console.
The original code functions in IE but faces issues in Chrome.
A solution is needed to either fix this function or create a different method that can asynchronously load a local XML/XSL file and store it in a variable specifically for Chrome.