On Cordova 5.x , for the android platform a plain ajax call does not work
It does not give any detailed error
status : 0
errortext : error
Things are changing.
After doing research on the issue and trying out different options, I came across this.
1. You need to install the cordova whitelist plugin (this is not available for ios currently though)
cordova plugin add cordova-plugin-whitelist
2. In config.xml
in place of the old,
And bam, all the ajax calls are working properly.
Note: You will need to add the following to your html files in the
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"/>
else you will get the following error message while running the app.
“No Content-Security-Policy meta tag found. Please add one when using the cordova-plugin-whitelist plugin.”
Hope it helps somebody facing similar issues.