So I’ve decided to break the habit of hardcoding things into my webapp and make it more dynamic with xml. I’m trying to load an xml file in the same directory as the main .html file, javascript files, etc. In the custom javascript file, I’ve declared variables “var xmlhttp;” & “var xmlDoc;” outside the functions.(This is a debug layout, not final product) When a button is pressed it runs a function:
if(window.XMLHttpRequest){
xmlhttp = new XMLHttpRequest();
} else{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","classes.xml", false);
xmlhttp.send();
xmlDoc = xmlhttp.responseXML;
Another button will run a function:
if(xmlDoc != null){
alert(":D");
}
However, it does not alert. If I switch the last function to xmlhttp instead of xmlDoc, it does alert. So, at least that’s being declared. I made sure that classes.xml is included in the new “Additional Project Files” property on the main .mobi screen. Any help with xmlDoc == null is appreciated.