XMLHttpRequest cannot load http: / / 10.1.25.88 / INSIX.DINSIX.WAP/SVCTimeSheetJson.svc / ListarTimetrackerPo…param0=D033E22AE348AEB5660FC2140AEC35850C4DA997¶m1=2014-10-22¶m2=1. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http :// 10.1.25.88:8100' is therefore not allowed access.
I'm getting this error when I try to access my application through the browser, using "ionic serve" cmd line.
PS: 10.1.25.88 is localhost.
This is the code invoked:
listarTimetrackerPorData: function (data, cod_profissional_prf) { url_webservice = URL_CONST + 'ListarTimetrackerPorDataJSON?param0=' + CH_TIMETRACKER_CONST + '¶m1=' + data + '¶m2=' + cod_profissional_prf; return $http.get(url_webservice).then(function (JSONresp) { return JSONresp; }); },
What's wrong?
This is due to browser security policies, CORS is the process to avoid this kind of error. Learn how to implement this on your server at http://enable-cors.org/.
I don't recommend testing your application in the browser, but if you insist, you can try adjusting your browser:
https://blog.nraboy.com/2014/08/bypass-cors-errors-testing-apis-locally/
The best way to test is to install it to your device.