> <body onload="javascript:google.load( 'maps', '2' );
> google.setOnLoadCallback(alert('Boo!');init(););" onunload="GUnload
> ()">
The way I'd interpret that is -
After the DOM is complete, the AJAX loader is requested to go fetch
the maps API.
NO onloadcallback function has been set at all for that maps request.
Then we set an onloadcallback for the loader itself, which will in
turn call init() whatever that may be, but let's guess its a map
initialising routine. There's no guarantee that the maps API will be
loaded before init() is called, bearing in mind this onloadcallback is
all about the loader itself.
The normal approach to going about it this way would be to do the
google.load('maps'..) inline in the head
http://code.google.com/apis/ajax/documentation/#GoogleLoad
Presumably the loader is smart enough NOT to trigger its onload until
all the modules which it was originally told about are loaded too.
Or, if you do need the maps API loaded after the DOM is complete
(which is what putting the request in the body onload implies) - the
usual way to do that would be to set init() as the onloadcallback of
the maps load request?
http://code.google.com/apis/ajax/documentation/#Dynamic
Seems to me there's two ways to go about it, but care needs to be
taken to use the appropriate callback, and mix'n'match of the two
methods causes tears.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---