So the link to the API is working for me when I open it in a window but for some reason it’s not working correctly in code and I can’t see why (or I don’t know why, it might just be something outside the my code I’m not aware of).
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
lon= position.coords.longitude;
lat= position.coords.latitude;
$("#data").html("latitude: " + lat + "<br>longitude: " + lon);
var api= "https://fcc-weather-api.glitch.me/api/current?lat="+lat+"&lon="+lon;
$.get.JSON(api, function(data){
var weatherType = data.weather[0].description;
var ktemp = data.main.temp;
var wind = data.wind.speed;
var city = data.name;
please somebody explain why it won’t recognize the API, or why it wont get anything from the JSON.