unable to cope with the asynchronous nature of navigator.geolocation.

Posted by Raja on Stack Overflow See other posts from Stack Overflow or by Raja
Published on 2010-04-25T04:49:38Z Indexed on 2010/04/25 4:53 UTC
Read the original article Hit count: 283

Filed under:
|
|

Hi all

I'm using the navigator.geolocation.getCurrentPosition(function) api in firefox 3.6. When i try to call this method repeatedly I see that sometimes it works and sometimes it doesn't. I figured that the problem is because of its asynchronous callback nature. I can see that the callback function is being called at some point but my outer function is already exiting so i cannot catch the values of the position coordinates.

I'm pretty new to javascript so i'm assuming other javascript coders might have already figured out how to deal with it. Please help.

Thanks

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about geolocation