I’m working on weather project right now. I’m using https://fcc-weather-api.glitch.me for simplicity. But I often get wrong data, (country :“JP”, and others which are obviously not correct). I need to refresh 2 or 3 times to have it right . Anybody experienced the same?
Can we see your code?
I often got this:
{“coord”:{“lon”:139,“lat”:35},“weather”:[{“id”:803,“main”:“Clouds”,“description”:“broken clouds”}],“base”:“stations”,“main”:{“temp”:28.23,“pressure”:1011,“humidity”:74,“temp_min”:26,“temp_max”:31},“visibility”:10000,“wind”:{“speed”:3.6,“deg”:230},“clouds”:{“all”:75},“dt”:1499396400,“sys”:{“type”:1,“id”:7616,“message”:0.0043,“country”:“JP”,“sunrise”:1499369792,“sunset”:1499421666},“id”:1851632,“name”:“Shuzenji”,“cod”:200}
Shuzenji is the cached result from the API. it’s a bug
Oh I see. How do I avoid it?
don’t think there is a way
I also have the same problem.
I use this to clear cache.
$.ajaxSetup({cache: false});
I just tried it. I put it before getJSON. And it didn’t work. I reloaded the page 3 times, and “Shuzenji” still appeared once. What’s wrong?