I'm developing an app using ionic on the macbook with OS X Yosemite.
When trying to send data via POST or receive via GET to a remote server, the error appears: Chrome:
XMLHttpRequest can not load link . In 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' link ' is therefore not allowed access. The response had HTTP status code 405
Firefox:
Blocked cross-origin request: Same Origin Policy prevents the remote resource from being read at link . (Reason: CORS request failed).
The original code was:
function getLeagues(callback){
$http.get('http://elite-schedule.net/api/leaguedata/2009')
.success(function(data){
callback(data);
});
}
And I modified it to the following by specifying the header
$http({
method: 'GET',
url: 'http://elite-schedule.net/api/leaguedata/2009',
headers: {'Access-Control-Allow-Origin': '*'}
})
.success(function(data){
callback(data);
I already followed the guidance given on the site: opensourehacker
The error persists. How do I disable these restrictions on these browsers by using this operating system?