Search the Community
Showing results for tags 'getLocation'.
-
I am using chrome. why the geolocation wont showing getLocation i checked on my advance setting there is no necessarily checkbox "Send a "Do Not Track" request with your browsing traffic" I am not sure what excalty the file will go through from the document.getElementById("demo"). I checked at http://www.w3schools.com/html/html5_geolocation.asp it does not help me please help me to success what did i wrong anyone who have experienced this problem before thanks! btw, I am using IDE note++ here the code is <!DOCTYPE html> <html> <body> <p>Click below to get your coordinates:</p> <button onclick="showLocation()">Click</button> <script> var x = document.getElementById("demo"); function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else{x.innerHTML = "Geolocation is not supported by this browser.";} } function showPosition(position) { x.innerHTML = "Latitude: " + position.coords.latitude + "<br>Longitude: " + position.coords.longitude; } </script> </body> </html>
- 4 replies
-
- geolocation
- html5
-
(and 4 more)
Tagged with: