TS_load_timers
The new version of the API loader inserts the following lines of code
into the calling page using document.write().
<script type="text/javascript">
if (typeof TS_load_timers == "object")
TS_load_timers.start("load maps.27a.js", "glm_maps.27a.js");
</script>
<script type="text/javascript">
if (typeof TS_load_timers == "object") TS_load_timers.end();
</script>
This happens whether you choose to tell it to load the new maps.28.js or
not, it's being done in the new API loader, not in the maps.xx.js code
itself.
In the unlikely event that you happen to have an object in your page
called "TS_load_timers" that isn't expecting to be called in this way,
you may like to consider renaming it.
On the other hand, if you happen to want to receive information about
load timings, you can create such an object and define .start() and
.end() methods for it. This needs to be done before loading the API code
<script type="text/javascript">
TS_load_timers = new Object();
TS_load_timers.start = function(a,b) {
this.a = a;
this.b = b;
this.startTime = new Date();
}
TS_load_timers.end = function () {
var elapsedTime = new Date().getTime() - this.startTime.getTime();
alert("Load time: " + this.a + " " + this.b +
": " + elapsedTime/1000+"seconds")
}
</script>
--
The Blackpool Community Church Javascript Team
http://www.econym.demon.co.uk/googlemaps/
0 Comments:
Yorum Gönder
<< Home