2
I am trying to develop a hybrid application using Ionic and Angularjs and for that I am testing in the browser.
When I do ionic serve
it creates a local server with the address localhost:8100/#/main
and my webservice tbm is on the localhost at port 80.
When I try to do some ajax requisicao for this webservice Firefox returns me the message:
Blocked cross-origin request: Same Origin Policy (Same Origin Policy) prevents reading the remote resource at
http://localhost/AppPanel/users/doLogin.json
. (Reason: CORS header 'Access-Control-Allow-Origin' is not present).`
I tried to disable this scan in Firefox this way: about:config -> security.fileuri.strict_origin_policy -> false
but I haven’t gotten any results yet. I did my webservice on Cakephp.
How to solve this problem?
@Bacco I am trying here, as soon as I can (if I can) put the answer. If I can’t create a virtual machine. thanks
– FernandoPaiva
You have implemented CORS in your API ?
– DiegoAugusto
Where is your service located and your front-end ? Are in the same directory or different directories?
– Felippe Tadeu
@Felippetadeu the Frond-end(browser app) and the back-end(webservice) are all on the localhost.
– FernandoPaiva
solved problem. I added the parameters to the Chrome shortcut
--args --allow-file-access-from-files --disable-web-security
and now it’s working. Thank you all.– FernandoPaiva