Cant get JSON from wheater api

any suggestions? thank you

There’s a couple of problems. First, your endpoint URL needs to be fully qualified, which means including the protocol at the beginning.

$.get("" + lati + "&lon=" + long + "...")

Second, even with your URL set, you’re going to run into cross domain issues. This can be solved quickly by using a CORS proxy. Add to the beginning of your URL.

$.get("" + lati + "&lon=" + long + "...")

Make sure you’re always connecting to CodePen via HTTPS.

1 Like