# $.getJSON won't work in codepen. PLEASE HELP - LOCAL WEATHER

**URL:** <https://forum.freecodecamp.org/t/getjson-wont-work-in-codepen-please-help-local-weather/75626>\
**Category:** General\
**Created:** [January 12, 2017, 12:01am UTC](https://forum.freecodecamp.org/t/getjson-wont-work-in-codepen-please-help-local-weather/75626 "2017-01-12T00:01:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![moeroddy](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@moeroddy](https://forum.freecodecamp.org/u/moeroddy)\
**Post date:** [January 12, 2017, 12:01am UTC](https://forum.freecodecamp.org/t/getjson-wont-work-in-codepen-please-help-local-weather/75626/1 "2017-01-12T00:01:38Z")

</div>

> **[jyqMqx](https://codepen.io/MoeRoddy/pen/jyqMqx?editors=1111)**
>
> ...

First: I had to make the url https instead of http so the geographical location can work  
second: $.getJSON(api, function(data) {  
});

is not working at all. I keep testing it using alert(“hi”) and it just doesnt work. I don’t know whats wrong.  
Please help me

---

<div class="post-metadata">

**Author:** ![BenGitter](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/bengitter/32/12192_2.png) [@BenGitter](https://forum.freecodecamp.org/u/BenGitter)\
**Post date:** [January 12, 2017, 12:31am UTC](https://forum.freecodecamp.org/t/getjson-wont-work-in-codepen-please-help-local-weather/75626/2 "2017-01-12T00:31:15Z")

</div>

You can’t make a http api request if you use https to load your site. You will either need to use a api that uses https or you can use something like [https://cors-anywhere.herokuapp.com](https://cors-anywhere.herokuapp.com)

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 16, 2021, 5:09pm UTC](https://forum.freecodecamp.org/t/getjson-wont-work-in-codepen-please-help-local-weather/75626/3 "2021-01-16T17:09:38Z")

</div>


