Skip to content
Advertisement

Tag: geolocation

Wait until a condition is true?

I’m using navigator.geolocation.watchPosition in JavaScript, and I want a way to deal with the possibility that the user might submit a form relying on location before watchPosition has found its location. Ideally the user would see a ‘Waiting for location’ message periodically until the location was obtained, then the form would submit. However, I’m not sure how to implement this

Advertisement