Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7714405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:07:08+00:00 2026-06-01T02:07:08+00:00

When asking the browser for permission to access the current position, what is the

  • 0

When asking the browser for permission to access the current position, what is the best way to determine if the user has either ignored the browser prompt, or selected the “Not now” option?

The timeout doesn’t seem to fire for this case.

if(navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position) {
        currentLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
        callback();
    }, function() {
        currentLocation = default_location;
        callback();
    },{timeout: 5000});
}

A solution I’m using now is to use a default location for currentLocation and refresh the page/view anytime one of the callbacks is fired due to the user answering the browser prompt.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T02:07:09+00:00Added an answer on June 1, 2026 at 2:07 am

    The 5 second timeout you’re specifying doesn’t start until the user has taken action, per the HTML5 geolocation spec.

    Note that the time that is spent obtaining the user permission is not included in the period covered by the timeout attribute. The timeout attribute only applies to the location acquisition operation.

    The second callback function should be firing as soon as the user clicks “deny” in their browser, but nothing will be fired if the user ignores the prompt and lets it sit. The traditional implementation is to assume that a user doesn’t have geolocation capabilities and won’t click on the prompt, using it more as an enhancement than a required feature.

    Alternatively, you could design the page to help guide users to take action, throwing a dark div masking the entire page with “Click up here” text.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know of a way to prevent the browser from asking the user
I'm not asking about uploading a file from a browser to a php script,
A potential client has come to me asking for a an app which will
Scenario: The browser submits a HTTP request to a server. The user simultaneously clicks
The web browser DOM has been around since the late '90s, but it remains
From a Firefox extension is there a way to get the XUL iframe/browser that
i want to expire the my browser session in case of user inactivity for
I am trying to track user location (HTML5 GeoLocation) on multiple domains, by asking
When a browser has JavaScript disabled, is the request for the .js files still
Asking for your help on this Oracle query. It's giving me the error 2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.