Charlie
Charlie

Reputation: 11767

HTML5 Geolocation, ask for location?

Is it possible to ask for the user's permission to get their location on demand? It's usually asked when the page asks for the location, such as navigator.geolocation, but won't ask again until after the page has reloaded and the script asks for the location again.

Is there anyway to have it ask on demand, ex.) after the user hits deny?

Upvotes: 5

Views: 2581

Answers (1)

Aaron_H
Aaron_H

Reputation: 1683

You have to either request location from another domain, or provide instructions on how to go into their browser and change their settings. Just like on iPhone how you have to go into settings if you accidentally deny a permission.

It's because the permission-asking is actually something implemented on a per-browser basis. You can imagine if geolocation was around in IE6 days, IE6 would automatically always accept. Your solution would have to execute based on the browser someone is using.

Upvotes: 3

Related Questions