mywebacc Posted June 30, 2014 Share Posted June 30, 2014 I can't use the function of geolocation in my desktop. Browsers are Firefox and Google Chrome. OS is window xp. I click the button to get positon and also click "share position info" The result: Firefox alert "Unknown error acquiring position" Google Chrome alert "Javascript notice: User denied Geolocation" <!doctype html><html> <head> <meta charset="utf-8"> <title>Geolocation test</title> </head> <body> <p>Your latitude:<span id = "latitude">000</span></p> <p>Your longitude:<span id = "longitude">000</span></p> <p><button onClick="getPosition()">click for your position</button></p> <script> function getPosition(){ if(navigator.geolocation){ navigator.geolocation.getCurrentPosition(showPosition, errorMessage); } else{ alert("this browser does not support geolocation"); } } function showPosition(position){ document.getElementById("latitude").innerHTML = position.coords.latitude; document.getElementById("longitude").innerHTML = position.coords.longitude; } function errorMessage(error){ alert(error.message); } </script> </body></html> I am trying to solve the problem by searching Google. I got some information in the following link: https://bugzilla.mozilla.org/show_bug.cgi?id=822967 Some people said that desktop can't use geolocation. Is it right? Any solution? Link to comment Share on other sites More sharing options...
davej Posted June 30, 2014 Share Posted June 30, 2014 Some people said that desktop can't use geolocation. Is it right? Any solution? The files need to be loaded onto a server. Geolocation won't work if the html file is merely on your pc. Link to comment Share on other sites More sharing options...
mywebacc Posted July 1, 2014 Author Share Posted July 1, 2014 I uploaded the file onto the server. But the result of firefox is the same. The result of Google Chrome alert "notice- Network location provider at 'https://www.googleapis.com': Returned error code 404" Link to comment Share on other sites More sharing options...
mywebacc Posted July 1, 2014 Author Share Posted July 1, 2014 woo... I try it in my iphone. Upload the script to server first. If I use GPS. It's work. I can check the latitude and longitude. (browser: Safari) I also try it in my tablet. It's work. (browser: unknown and firefox) However, my desktop is not work. (browser:Chrome and firefox) Somebody said desktop can use ip address to estimate latitude and longitude. But it seems to be wrong. Link to comment Share on other sites More sharing options...
davej Posted July 1, 2014 Share Posted July 1, 2014 If the device has GPS it should work. If the device is a laptop that doesn't have GPS then it returns an estimate based on your IP address that is usually several miles away. Link to comment Share on other sites More sharing options...
justsomeguy Posted July 1, 2014 Share Posted July 1, 2014 Your desktop browser might also be automatically set to deny geolocation requests. Link to comment Share on other sites More sharing options...
mywebacc Posted July 2, 2014 Author Share Posted July 2, 2014 Your desktop browser might also be automatically set to deny geolocation requests. But I click "share my position". I am not quite sure, but I think I do not deny the goelocation requests. Do you have any idea to accept the geolocation requests? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now