and THIS is where I’m going nuts …
everyone and their friends are stating a boatload of ways to program this app all in contradiction of the instructions … use this api or that api, use ajax, no use JSON no use JSONP, change the http(s) don’t worry about it just use whatever
The problem is that in Chrome you need to serve your page over https for the geolocation to work. And if you use https for your main page, it is required to use https for API requests as well. Since Openweathermap does not support https requests, I would suggest using an API that does allow https or, as @PortableStick suggested, to use cors-anywhere to overcome these http/https problems.
I believe the instructions were made before Chrome stopped geolocation access from http and haven’t been changed since. Now, you can still use Openweatermap in combinationo with cors-anywhere, but it is a less ideal solution. That is why I suggest using a different API (if you haven’t started yet).
Many people are struggling with this project and it will be removed from the new curriculum. (Or added as bonus project).
You are going to be totally fine if you follow the instructions. But you will have to use something like cors-anywhere (something the instructions don’t mention).
$('#uLat').html(uLat); // uLat and uLon are objects and can't be passed as HTML
$('#uLon').html(uLon); // You'll probably see something like [object OBJECT] instead of numbers
I would change the variable assignment a bit to fix this.
var uLat = gotPosition.coords.latitude;
var uLon = gotPosition.coords.longitude;
I remember how confusing this all was when I was learning it. There’s a lot to sift through. @BenGitter’s advice is solid - a securely hosted service should always be preferred and will often mean fewer headaches. Though, as I myself recently learned, HTTPS isn’t always enough to guarantee you’ll be able to use the data from your AJAX call. A lot of these services don’t want you to make AJAX requests from the browser and are meant to be accessed by your own sever code, then sent to your client. A CORS proxy smoothes this over for you, so I’ve taken to it as the safest recommendation is the widest range of cases. You’ll have much more control when you can write server-side apps.