Phonegap local build - jquery ajax error: readystate 0 response username 0 statustext error

hope someone can help.

I am developing a telephone application.

The problem is that when I launch the application using the desktop browser or even a mobile application for mobile phones, the request is fine, but when I create the phonegap build android locally using CLI v5.4.1, the phonegap build android outputs to projectroot / platform / android / build /output/apk/android-debug.apk, I get the error message "readystate 0 responsetext status 0 statustext error"

this is my code

 $.ajax({ type: 'GET', url: "http://www.domain.com/gateway.php?structure", timeout: 5000, success: function(result) { var res = JSON.parse(result); res.forEach(function(element, index) { System.structure[element.company.id] = element; }); }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert('error: ' + JSON.stringify(XMLHttpRequest)); } }) 

and this is my config.xml

 <plugin name="cordova-plugin-inappbrowser" source="npm"/> <plugin name="phonegap-plugin-push" source="npm" /> <icon src="icon.png"/> <access origin="*"/> <plugin name="cordova-plugin-whitelist" version="1" /> <allow-intent href="http://*/*"/> <allow-intent href="https://*/*"/> 

I think this is very strange, and after searching for all such questions, I did not receive an answer.

What am I doing wrong?

+7
jquery android ajax cordova config
source share
1 answer

Have you included content security meta-text in your index file?

Cordoba Content Security Policy Link

0
source share

All Articles