DedicatedNoobGuy DedicatedNoobGuy - 1 year ago 104
HTML Question

Geolocation not working for me

Good Day,

I was having a bit of a problem getting my project to display the local weather together. I think once I have the coordinates set then it should be smooth sailing, but for some reason I've been unable to get the longitude and latitude to show. I had previously had an issue with not having the proper javascripts loaded so I made sure that I loaded up geolocation and jquery for this one. I also made sure my chrome was up to date, but it worked with the freecodecamp that I programmed so don't think that's the problem.

In fact I loaded the script I had written for freecodecamp almost verbatim to try to get this right before I customized the code, but like I said, it's not loading in my pen, so any help would be more than appreciated. Thanks!


Your Local Weather Forecast
At your location of:

if (navigator.geolocation) {
{$("#data").html("latitude: " + position.coords.latitude + "<br>longitude" + position.coords.longitude);


<div id = "data">
<h4>You are here:</h4>


Answer Source

If you are trying to do this in chrome and in http, it will not work, because chrome does not allow it anymore, either use a different browser or use https :)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download