Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

777
Views
Phonegap local build - jquery ajax error: readystate 0 responsetext status 0 statustext error

hope someone can help.

I am developing a phonegap app.

The problem is that when I run the app using a desktop browser or even the phonegap mobile app the request runs fine but when I build locally using the CLI v5.4.1 phonegap build android the cli outputs at projectroot/platforms/android/build/outputs/apk/android-debug.apk i get the error "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 find this to be very peculiar and after searching all similar questions I have come to no answer.

What am I doing wrong?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Have you included a content security meta tag into your index file?

Content Security Policy Cordova Reference

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!