# Access-controll-allow-origin is not allowed

**URL:** <https://forum.ionicframework.com/t/access-controll-allow-origin-is-not-allowed/49858>\
**Category:** ionic-v1\
**Created:** [April 20, 2016, 10:35am UTC](https://forum.ionicframework.com/t/access-controll-allow-origin-is-not-allowed/49858 "2016-04-20T10:35:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![powerful](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@powerful](https://forum.ionicframework.com/u/powerful)\
**Post date:** [April 20, 2016, 10:35am UTC](https://forum.ionicframework.com/t/access-controll-allow-origin-is-not-allowed/49858/1 "2016-04-20T10:35:21Z")

</div>

hello guys  
im using $http to get a json file but when i view it by console.log() throw me following error :

XMLHttpRequest cannot load [http://www.example.com/api.json](http://www.example.com/api.json). Origin [http://localhost:8100](http://localhost:8100) is not allowed by Access-Control-Allow-Origin.

i followed this post [[http://blog.ionic.io/handling-cors-issues-in-ionic/](http://blog.ionic.io/handling-cors-issues-in-ionic/)](cors issue) to use proxy but it give me 404 error!!

can anyone help me ?

---

<div class="post-metadata">

**Author:** ![Destroy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/destroy/32/94194_2.png) [@Destroy](https://forum.ionicframework.com/u/Destroy)\
**Post date:** [April 20, 2016, 10:47am UTC](https://forum.ionicframework.com/t/access-controll-allow-origin-is-not-allowed/49858/2 "2016-04-20T10:47:35Z")

</div>

Hi

did you try with jsonp?

---

<div class="post-metadata">

**Author:** ![powerful](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@powerful](https://forum.ionicframework.com/u/powerful)\
**Post date:** [April 20, 2016, 10:59am UTC](https://forum.ionicframework.com/t/access-controll-allow-origin-is-not-allowed/49858/3 "2016-04-20T10:59:10Z")

</div>

thanks.its worked by using $http.jsonp(), but why it does not work with $http.get() ?!

---

<div class="post-metadata">

**Author:** ![Destroy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/destroy/32/94194_2.png) [@Destroy](https://forum.ionicframework.com/u/Destroy)\
**Post date:** [April 20, 2016, 11:10am UTC](https://forum.ionicframework.com/t/access-controll-allow-origin-is-not-allowed/49858/4 "2016-04-20T11:10:25Z")

</div>

Maybe because you are trying to reach some some domain that does not allow cross domain.

Here you can read more about this.

> **[Cross-Domain requests in Javascript](https://jvaneyck.wordpress.com/2014/01/07/cross-domain-requests-in-javascript/)**
>
> If you are developing a modern web-based application, chances are you: Are using javascript on the client side. Need to integrate with services that are not completely under your control (or that r…
