Error with response, but fire bug shows there is a response?
Hey all , I keep getting this error which is hard for me to explain unless show you the code:
Code:
var xmlHttp;
try
{
xmlHttp = new XMLHttpRequest();
}catch(e)
{
try
{
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e)
{
try
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}catch(e)
{
alert("Your browser does not support AJAX!")
}
}
}
function CustomerRequest(){
var address = document.getElementById("request").value;
xmlHttp.onreadystatechange = HandleResponse;
xmlHttp.open("GET", "ajax.php?address="+address, false);
xmlHttp.send(null);
}
function HandleResponse()
{
if (xmlHttp.readyState == 4 && xmlHttp.readyState == 200) {
RequestXML();
} else{
alert("status is " + xmlHttp.status);
}
}
function RequestXML()
{
xmlHttp.onreadystatechange = ReadXML;
xmlHttp.open("GET","write.xml",false);
xmlHttp.send(null);
}
function ReadXML(){
if (xmlHttp.readyState == 4 && xmlHttp.readyState == 200) {
var xml = xmlHttp.responseXML;
GenerateMap();
}else {
alert ("Status is also "+xmlHttp.status);
}
var addy = xml.documentElement.getElementByTagName('address');
for (var i=0; i<addy.length; i++)
{
var address = add.getAttribute('addy');
document.write(address);
}
}
function GenerateMap(){
var map;
var geocoder;
geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
}
See where I got the line if (ready state == 200), this is where the problem rises. But when I watch fire bug it tells me there was a response of what I expect, what do?
Thank you.