I am making a json request that is valid however i am unable to see the response in the log when using:
console.log(data);
the first request works however the second does not.
Thanks
I am making a json request that is valid however i am unable to see the response in the log when using:
console.log(data);
the first request works however the second does not.
Thanks
http://maps.googleapis.com supports CORS, but https://api.forecast.io does not. For forecast.io, you should use JSONP, easiest way to do that in jQuery is adding "?callback=?"
to request URL:
$.getJSON('https://api.forecast.io/forecast/<API KEY>/' + lat + ',' + lon + "?callback=?", function(data1) {
console.log(data1.currently.summary);
});
However, you should avoid exposing your api key as stated in forecast.io api docs. Creating a reverse proxy to that service might be a good idea.