Origin is not allowed by Access-Control-Allow-Origin

后端 未结 18 2935
北海茫月
北海茫月 2020-11-21 05:52

I\'m making an Ajax.request to a remote PHP server in a Sencha Touch 2 application (wrapped in PhoneGap).

The response from the server is the following:

18条回答
  •  无人共我
    2020-11-21 06:21

    If you're using Apache just add:

    
        Header set Access-Control-Allow-Origin: *
    
    

    in your configuration. This will cause all responses from your webserver to be accessible from any other site on the internet. If you intend to only allow services on your host to be used by a specific server you can replace the * with the URL of the originating server:

    Header set Access-Control-Allow-Origin: http://my.origin.host
    

提交回复
热议问题