Show the local weather - why get json is not working?

Here is my JS code:

$(document).ready(function() {

  $.getJSON( ",0", function( data ) {


I tried to use openweather, but no success.
I know already about html/htmls problem on
Some other APIs work fine when i call them.

Can anyone help?

(edited to give more info)

Could you please post your project on CodePen or Github?

Right, sorry.

I am quite frustrated, because it was working few days ago, so i submitted it as complete.
Then i just came back to review and - bad luck.
Took everything apart to find where was the problem, ad there it is - get json not getting json.

Thanks if you can give any help/advice.

The Darksky API doesn’t allow direct request from the client:

The browser’s console will give you a helpful error text:

The problem is that DarkSky delivers its data with a header that says, in effect, “here are the domains that can access this response”. The error says that CodePen isn’t on that access list. DarkSky did, in fact, work at one point, but they’ve since changed their policies (I wonder if all of the FCC students using their free tier had something to do with this). It sounds fishy, but in actuality accessing DarkSky directly from the client is a horrible idea and they’re not wrong in trying to deter it. Services like this are actually meant to be accessed on a server and then delivered to clients in a way that’s easier to control. This is one reason the coming curriculum refresh is going to de-emphasize AJAX.

But what do we do about this now?

Use cors-anywhere. Drop this in front of your URL and you’ll get your data again.


Good to hear that it will be dropped.

I found cause of my woes - noscript.

Even though i allowed everything on codepen, it was blocking scripts from other sites.
…and did not show that they are blocked.

Thank You for help, cors is doing fine.

I hope i’ll finish this in another hour and move on with my life.

Getting unstuck is quite fun.