Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

774
Vistas
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 Respuestas
Responde la pregunta

0

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

Content Security Policy Cordova Reference

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda