Cross-Origin Request Blocked

Am stacked and I can’t proceed.Before I managed to send data to the online server but suddenly I got an error “Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://xxx.com/sample/get_data.php. This can be fixed by moving the resource to the same domain or enabling CORS.”

please help

You have to activate CORS on server side.

Basically adding the following header:
Access-Control-Allow-Origin : “*”

I have added that header but still I can’t proceed.Am using mozilla browser.In mobile it works very well, the problem is on mozilla when testing the apps before deploy it on mobile.

you cannot make cross domain call because of browser security.
you need to disable browser security to do that.

or you can use Ripple Emulator to test your app before deployment.

ripple is a chrome extention that allow you to test cross platform cordova application.

Extention Link:

https://chrome.google.com/webstore/detail/ripple-emulator-beta/geelfhphabnejjhdalkjhgipohgpdnoc?utm_source=chrome-app-launcher-info-dialog

open this link in chrome extension.

In mobile Access-Control-Allow-Origin : “*” will allow to make a cross domain call.