Trouble with Weather - Dark Sky API and Chrome


Hey everyone, so this is my current Weather Locator Project thing. I cannot seem to get it to work whatsoever, the code is able to use the IP API on my work laptop on Internet Explorer but not on my personal laptop on Chrome for some reason. Then, when I do get IP coordinates, my dark sky api does not run. Could anyone help me with this? I’ve been trying to look through the forum for help but I haven’t been able to solve it.


Codepen requires you to make all of your API calls over HTTPS. Your location API only works over HTTP, so you’ll need a different API that works over HTTPS, like or

If you update your code for another API, the rest of your code works fine:

function getLocation() {
  var urlIP = "";
  $.getJSON(urlIP, function(data) {
    var LocInfo = data.latitude + "," + data.longitude;
    $("#city").text( + ", " + data.region_code);

Moving forward, you can debug these errors by looking at your browser’s developer console and searching for the errors provided. (Ctrl+Shift+J on Windows / Command + Option + J on Mac). The console in codepen won’t give you the errors you need.


I found this challenge to be particularly challenging since the Dark Sky API blocks Cross Origin Requests, and the Open Weather API won’t work on SSL unless you pay $80+ per month, I put together a quick hack to work around the API issues (See: For those of you who are stuck on the Weather API Projects), realistically I want to write a Heroku app that does this that anyone can deploy without too much work, I’ll try to do that in the near future. The example proxy I provided should work with either of the APIs. Good luck :slight_smile:


Sorry to leave your response hanging for so long, I didn’t have my notifications on for the forum :(. Thank you so much though, this worked perfectly.


You can try the ZetPush is good tool.