That example is no bodge job!

It'll poll the DOM til the element that you want to manipulate exists
and then manipulate it - end of story.
Change the poll frequenqy - maybe set a limit to the number of times
that the timeout will execute before it gives up.

The Google Maps API doesn't trigger many (or even any) events to let
you know that it has created a DOM element 'sometime' after you asked
it to.

Martin.


On Jun 23, 1:30 pm, Paul Smith <[email protected]> wrote:
> I've never been a big fan of "wait for sometime and hope" code, although I
> appreciate it often works :-).  Is there a more rigourous way to achieve
> what you are doing, i.e. wait for the DOM to create the object?
>
> And on a general Javascript theme, there seem to be lots of instances where
> a script requests something and then a callback indicates it has completed.  
> Do people tend to just chain "request, wait for callback, request, wait for
> callback...", or "request it all, each callback checks if everything is
> done"?  Or is there a cunning "you requested lots of things and now they are
> ALL done" Javascript mechanism which I've not come across yet?
>
> Thanks,
> Papadeltasierra

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to