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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:22:31+00:00 2026-05-22T14:22:31+00:00

I am trying out geolocation with HTML5. For some reason it works on firefox

  • 0

I am trying out geolocation with HTML5. For some reason it works on firefox inconsistently and it does not work on chrome and throws an error called object positionerror.

2 questions

1.) How do i see the actual error (sorry I am new to javascript)
2.) Why is it working differently on chrome and firefox?

The script is as below –

<script>

if(!navigator.geolocation) {
    alert ('your browser sux');
} else {
    navigator.geolocation.getCurrentPosition(success, error);
}

function success(position) {
    var lat = position.coords.latitude;
    var lng = position.coords.longitude;

    document.write(lat + ', ' + lng);

} 


function error(error) {
    alert ('damn error' +error);




}

  • 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-22T14:22:32+00:00Added an answer on May 22, 2026 at 2:22 pm

    JavaScript doesn’t have to be hard to debug. Every reasonably modern browser has a debugger:

    • Safari, Chrome, IE8+ and Firefox 4 have built-in developer tools
    • For Firefox 3 and 4, there’s also Firebug

    As for the actual issues with using navigator.geolocation, you might be interested in the Dive Into HTML5 Geolocation chapter.


    To get to Chrome’s Developer Tools, either:

    • Wrench -> Tools -> Developer Tools, or
    • View -> Developer -> Developer Tools

    If you want to see the JavaScript code, add breakpoints, step through the code, etc. you’d use the Scripts tab. The other tab I spend most of my time in is the Console.

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

Sidebar

Related Questions

I'm trying to work out the watch position with android but its not working!!
I'm trying out some LINQ expressions and can't get them to work with the
Trying out the examples found on pleac.sf.net , I'm not able to get an
I'm constructing a geolocation based application and I'm trying to figure out a way
Trying out the following, will result in error. How do I retrieve the values
Just trying out some C on some of the project euler questions. My question
For trying out some pointer stuff, I made an instance variable in an existing
Just trying out ubuntu server on my pc and have been testing some commands
I trying out some problems in Google's Code Jam. For the question Store Credit
Trying out mechanize to scrape some content off an https asp site, it looks

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.