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

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

    I will give you a simple solution for this one. In my case I don't have access to a server. In that case you can change the security policy in your Google Chrome browser to allow Access-Control-Allow-Origin. This is very simple:

    1. Create a Chrome browser shortcut
    2. Right click short cut icon -> Properties -> Shortcut -> Target

    Simple paste in "C:\Program Files\Google\Chrome\Application\chrome.exe" --allow-file-access-from-files --disable-web-security.

    The location may differ. Now open Chrome by clicking on that shortcut.

提交回复
热议问题