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

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

    If you get this in Angular.js, then make sure you escape your port number like this:

    var Project = $resource(
        'http://localhost\\:5648/api/...', {'a':'b'}, {
            update: { method: 'PUT' }
        }
    );
    

    See here for more info on it.

提交回复
热议问题