Hi,
I'm using an XHR ajax request to update an info window on one point,
with simply the current date and time from a php script. I'm thinking
I have something wrong with the below function, as the date and time
is always from the PRIOR XHR request, not the current one as I'd like.
This is in Firefox. Internet Explorer doesn't update the date/time
dynamically at all, only on a complete page refresh. Any thoughts ?
Thanks.
function createInfoMarker(point) {
var marker = new GMarker(point);
GEvent.addListener(marker, "mouseover",
function() {
request.onreadystatechange=function()
{
if(request.readyState==4) {
if (request.status == 200)
{
datevalue=request.responseText;
}
}
}
var url = "datetime.php?t=" + new Date().getTime();
request.open("GET",url,true);
marker.openInfoWindowHtml(datevalue);
request.send(null);
}
);
GEvent.addListener(marker, "mouseout",
function() {
marker.closeInfoWindow();
}
);
return marker;
}
var map = new GMap(document.getElementById("map"));
map.centerAndZoom(new GPoint(-75.632496, 38.721503), 3);
map.addControl(new GLargeMapControl());
var point = new GPoint(-75.542496, 39.751503);
var marker = createInfoMarker(point);
map.addOverlay(marker);
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---