How to Solve Javascript Cross Domain




Alternative Solution: quick and easy: https://youtu.be/3EWrbFfedrA

In this video I show you How to Solve Javascript Cross Domain issue. I give two solutions. One to use while in development stage and one for your server. Solves this error: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Original source


24 responses to “How to Solve Javascript Cross Domain”

  1. Hi!! First solution I dont belive it work for production, it only solves local test. But what I realize from your video is that you can set header in server file to allow drawing html on any browser. In mi php file on server I include:
    header("Access-Control-Allow-Origin: *");
    and now I can see html response on any browser. Hope this help!!!
    Thanks!!

  2. Hello, really very useful. I have another doubt. In my case I'm the developer of the webservice API and I have an app B that is trying to request a json file form mu API but when I try i receive that error message. What should I do to allow any request? because in my case the API has public content and should be as easy as possible to the users of N other apps get that data

Leave a Reply