Hello,
i am having a problem with loading data from an api. I am working on weather app.
I am using opernweather api. The problem is with getting JSON data. Here is the jQuery code:
var longitude = 46.0553;
var latitude = 14.5144;
var apikey = /* my openweather apikey */;
var url = 'api.openweathermap.org/data/2.5/weather?lat='+ latitude +'&lon='+ longitude+ '&APPID=' + apiKey;
$.getJSON(url, function(result){
console.log(result);
})
The response i get is:
Cannot GET /weather%20app/api.openweathermap.org/data/2.5/weather?lat=46.0553&lon=14.5144&APPID={apikey}
But if i use this URL directly in a browser it works fine…