Route traffic by country, state & city using redirects or popups. View Live Demo's ->
July 10, 2020

How does getCurrentPosition() work in the HTML5 geolocation API?

NI

How does getCurrentPosition() work in the HTML5 geolocation API?

GT
Answer
by Geo Targetly

The getCurrentPosition() method obtains the current position of the device. It works by entering the following syntax navigator.geolocation.getCurrentPosition(success[,error[, [options]]). The code can trigger three different conditions: A successful callback, an error callback and an optional PostionsOptions object.

Tags:
HTML5 geolocation, get current position

"Hands down one of the best marketing tools you are not using"

Chad T. - Web & Digital Media Director

Get started in minutes
No credit card required
Free on-boarding support
Your Privacy

We uses cookies to improve your experience on our site, analyse site traffic and to show you relevant content. By using our website, you consent to our use of cookies. For more information please, see our Privacy Policy

ACCEPT