> 2. I still don't understand why the original code was failing, the
> variables were filled in whilst debugging it but still the code
> failed.

It's all a question of order

asynchronous function (callback {
               populate variable
               alert (variable)
               }
display variable

'variable' will always be unpopulated at the time of display, because
the asynchronous callback won't have happened when that code is
reached.  After that, the asynchronous code will execute, populate
'variable' and alert a value.

> What are the best ways to debugthis asynchronous code and
> really debug what is happening?

If you use Firebug, an easy way is to use the 'console' feature to log
progress messages.

-- 
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 google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to