If you want to keep things simple, JSON is just a javascript object. Nothing more (little bit less actually :D). So when you request JSON data from API, you get a javascript object in a string form. You need to parse it into an object so JS can understand it, .
In terms of AJAX, I think the easiest way is to keep it as simple as possible. So until you understand and need to do otherwise, just presume that the request is always successful. When you have that down, then you can delve into error handling and state.
If you have the latitude and longitude, then you make a request to the server like that:
//vanilla JS. I have the logic wrapped in a function,
// but ofc u could do without.
function getData(url) {
//we require a new request object
let request = new XMLHttpRequest()
//then we specify the type of request, address,
//and what happens when the request is successful
request.open("GET", url)
//when response comes, we will load the it into the console.
// but we could do whatever we want with it ofc.
request.onload = function() {
//responseText is the actual answer. This is the JSON
// that you need. Now we parse it into a JS object.
var weather = JSON.parse(request.responseText)
console.log(request)
console.log(request.responseText)
console.log(weather)
console.log(weather.main.temp)
}
//when all things are specified, we send the the request out,
// and the rest (ie the handling of the response) will happen when we get it back.
request.send()
}
var lon = 42
var lat = 24
getData("https://fcc-weather-api.glitch.me/api/current?lat=" + lat + "&lon=" + lon)
// above should get a JSON about weather somewhere. Take a look of
// those logs in the console and you will see the the returning object
// (browse it, look at all those things you will understand in the future :))
// and similarities and differences between the formatted and unformatted data.
// jQuery would make syntax simpler,
// but it is important to understand vanilla. So get at it!