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

后端 未结 18 3045
北海茫月
北海茫月 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:22

    As Matt Mombrea is correct for the server side, you might run into another problem which is whitelisting rejection.

    You have to configure your phonegap.plist. (I am using a old version of phonegap)

    For cordova, there might be some changes in the naming and directory. But the steps should be mostly the same.

    First select Supporting files > PhoneGap.plist

    enter image description here

    then under "ExternalHosts"

    Add a entry, with a value of perhaps "http://nqatalog.negroesquisso.pt" I am using * for debugging purposes only.

    enter image description here

提交回复
热议问题