When I run the code below it fails. I've run the exact same code without the ID appended to the url and it worked just fine. Am I appending it incorrectly?
// CALLS THE PHPSLQAJAX_GENXML2 PAGE AND RETURNS VALUES
function downloadUrl(url, callback){
var request = window.ActiveXObject ?
new ActiveXObject('Microsoft.XMLHTTP') :
new XMLHttpRequest;
request.onreadystatechange = function() {
if (request.readyState == 4) {
request.onreadystatechange = doNothing;
callback(request, request.status);
}
};
request.open('GET', url, true);
request.send(null);
}
//https://developers.google.com/maps/documentation/javascript/examples/marker-remove
function addMarker(locid) {
var infoWindow = new google.maps.InfoWindow;
downloadUrl("location.php?id=" . locid , function(data) {
var xml = data.responseXML;
var markers = xml.documentElement.getElementsByTagName("marker");
for (var i = 0; i < markers.length; i++) {
var id = markers[i].getAttribute("id");
var name = markers[i].getAttribute("name");
var type = markers[i].getAttribute("type");
var icon = markers[i].getAttribute("icon");
var point = new google.maps.LatLng(
parseFloat(markers[i].getAttribute("lat")),
parseFloat(markers[i].getAttribute("lng"))
);
var html = "<div class='title'>" + name +
"</div><div class='basicinfo'><div class='addr'>" + address +
"</div><div class='website'></div><div class='phone'>" + phone +
"</div>";
var marker = new google.maps.Marker({
position: map,
position: point,
icon: icon
});
bingInfoWindow(marker, map, infoWindow, html);
markers.push(marker);
}
});
}