Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

775
Visualizações
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 Respostas
Responde à pergunta

0

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

Content Security Policy Cordova Reference

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda