I get the following in my console
GET http://localhost/FCC%20Projects/Show%20Local%20Weather/api.openweathermap.o…9999&lat=43.3104064&APPID=4c45bb0e6071b74cf43da0d4aa498377&_=1440245698059 404 (Not Found)
if i take out the http://localhost/FCC%20Projects/Show%20Local%20Weather/
part and paste the remaining in the browser bar, i get the proper response from the api service.
I get the same problem on gh-pages except that it is prefixed with the GitHub address. http://adoyle2014.github.io/FCC-ShowLocalWeather/
function apiCall(lat, long) {
$.ajax({
url: "api.openweathermap.org/data/2.5/weather?",
jsonp: "jsonp",
dataType: "jsonp",
data: {
lon: long,
lat: lat,
APPID: apiKey
},
success: function (response) {
parseWeather(response);
}
});
why does this api call prepend the url with the current website address?
http://
. Longer explanation as answer coming up!