Thursday, February 02, 2006

Auto Refresh Content | Access No Cached Data

The following code snippet is Javascript on the client to directly access data without caching.
----------------------------------------------------------------------------
var request = GXmlHttp.create();
var url = "AlumData.aspx?RandomKey=" + Math.random() * Date.parse(new Date());
request.open('GET', url, true);
request.onreadystatechange = function() {
if (request.readyState == 4) {
var xmlDoc = request.responseXML;
var markers = xmlDoc.documentElement.getElementsByTagName("marker");
for (var i = 0; i < markers.length; i++) {
var point = new GPoint(parseFloat(markers[i].getAttribute("lng")),
parseFloat(markers[i].getAttribute("lat")));
var info = "" + markers[i].getAttribute("title") + "
";
info += "My Message: " + markers[i].getAttribute("message");
var marker = new createMarker(point, info);
map.addOverlay(marker);
}
}
}
request.send(null);
-------------------------------------------------------------------------------
To see the page in action, you could visit:
http://backup.kelley.iupui.edu/Googlemap/alummap.aspx

Note: the pages could be removed at any time.

0 Comments:

Post a Comment

<< Home