Hello All,
I am having trouble getting to the correct file. I have an XML file named google.XML that is located in the App_Data folder. I have an Asp.net page named incidents located in the same web project but in folder named incidents. If I place the google.XML file in the folder named incidents the code below works just fine, but if I put it in the App_Data folder, I get the evil 404 error. I believe my problem is I have not correctly point to the correct folder, but I have tried every combination I can think of. If anyone has any ideas, I would be forever grateful.
Below is the code.
Also, I know this is all javascript, but I thought the question was more relevant to Asp.net and not javascript, if I am wrong please move this to the correct forum.
CODE
var xmlhttp = false;
getHTTPRequestObject();
function getHTTPRequestObject() {
try {
//try legacy object first
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
//try IE implementation now
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
}
function getXMLData()
{
xmlhttp.open("GET", "App_Data\google.xml", true);
xmlhttp.onreadystatechange = callback;
xmlhttp.send(null);
}
function callback() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
var xmlresponse = xmlhttp.responseXML.documentElement;
var textresponse = xmlhttp.responseText;
var finddiv = document.getElementById("divResponse");
finddiv.innerText = textresponse;
// alert(trimString(xmlresponse.getElementsByTagName
//("marker")[0].firstChild.data));
}
}
}