I’m really trying to get my hands around this whole AJAX business, both the more traditional Javascript type (GoogleMapsExample (GME)) and the ICE Faces business.
I’m currently looking at the GME and I find myself wishing there was an example that actually went back to my localhost server instead of an external source. Be that as it may, I can’t seem to understand this part of the Javascript of the GME. Hopefully the “google.load(“maps”,”2″); will be bold below.
I understand, or think I understand, the (src=”http://…) portion going to Google, but how does the “google” object suddenly appear? Does the call to (src=”http://…) return some google API and add it to standard Javascript objects capability… such as the “window” object? That’s all I can figure.
<script type=”text/javascript”
src=”http://www.google.com/jsapi?key=ABQIAAAA7rD1jbUY1XVWsL0ov0bKehRP189eykzPrrAV7tRgT92eURxrGxQHDNt6Nc2DQaubssvpI9493dhTGg”>
</script>
<script type=”text/javascript”>
google.load(“maps”, “2”); var map = null;
var geocoder = null;
google.setOnLoadCallback(function initmap() {
map = new google.maps.Map2(document.getElementById(“map”));
geocoder = new google.maps.ClientGeocoder();
});
</script>
<script type=”text/javascript” src=”resources/map.js”></script>
Again, it would be really a nice thing if there was an example on demand that made a similar call to the localhost server instead of an external server such as Google… so that the whole thread could be followed instead of the Gooble black box.
Thanks for reading.
Doug Hurst