Jump to content
Sign in to follow this  
ironheartbj18

Geolocation wont work!

Recommended Posts

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>
Edited by davej

Share this post


Link to post
Share on other sites

I made the video making things of thousand description what is going on and easier for you to understand https://www.youtube.com/watch?v=igM41r4Rzko&feature=youtu.be

 

it only give a minute.

 

you will see the setting on chrome there have three checkboxs on list.

 

w3school.com is working

 

notepad++ is NOT working???????????????????? seem its not right... it wont let me approved or blocked in somewhat.

 

please help thanks!

Edited by ironheartbj18

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...