In my angularjs app, i made this service :
/* ConnectivityService */
fara.factory('ConnectivityService', ['$resource', function ($resource) {
return $resource(
'http://www.google.com/',
null,
{
'check': {method: 'GET', isArray: false, cache: false}
}
);
}]);
called like that
/* ----- SERVICE ConnectivityService.check(); ----- */
ConnectivityService.check(function(responseSCon) {
// show response
console.log(responseSCon);
}, function (msg) {
// final reject
});
but i have this error
XMLHttpRequest cannot load http://www.google.com/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'my-website-here' is therefore not allowed access.
I don't understand, it's not a POST request, it's GET, so why this warning ?