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 6622077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:21:32+00:00 2026-05-25T21:21:32+00:00

I am currently using Modernizr to detect whether or not geolocation is supported for

  • 0

I am currently using Modernizr to detect whether or not geolocation is supported for a particular device. However, I want to display a more specific error message if geolocation is supported, but the user has disabled location services for their device.

I’m getting complaints that geolocation isn’t working on supported browsers, when in fact it’s just that the user hasn’t enabled theirs.

I know there are ways to detect this using native mobile code, but is there a way to do this with JavaScript? Does Modernizr support this?

  • 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-05-25T21:21:32+00:00Added an answer on May 25, 2026 at 9:21 pm

    Does your error callback ever fire? If you don’t have one, try adding one. If it never fires, you can set a timeout on your function that if it does not receive permission within a certain amount of time, to display a notification.

    Since the errorCallback never fires if geo is disabled, create a wrapper around the function that will create a settimeout on another function. If either of the callbacks to the api do fire, then remove the settimeout before it fires.

    var timeOutId;
    function disabledGeoHandler(){...}
    function show_map() {
        clearTimeout(timOutId);
        ...
    }
    function show_map_error() {
        clearTimeout(timOutId);
        ...
    }
    function lookup_location() {
      timeOutId = setTimeout(disabledGeoHandler, 1000);
      navigator.geolocation.getCurrentPosition(show_map, show_map_error);
    }
    

    In fact, you could just use geo.js

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

Sidebar

Related Questions

Currently using: @^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?$ How can i make http:// not compulsory but if it does
currently using spring 'exposedContextBeanNames' to allow me to display properties in my view but
Currently using Oracle/BEA/Plumtree ALUI Portal 6.1, and am trying to display a client's IP
Im currently using the JQuery UI extension for its search autocomplete. However, I need
Currently using wxHTML to display a remote web page in a C++ Windows wxWidgets
Im currently using base64_encode for some $_GET params that i don't want regular user
I am currently using Java to communicate with device through Serial communication. I have
I am currently using QLPreviewController to view PDFs (250MB+) However it cannot deal with
I am currently using a datareader as the source but I want to instead
Im currently using Classic ASP and developing my website with it. I want to

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.