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

135
Views
Ajax requests are failing on Cordova Android app

When I ran the project on Chrome browser the ajax requests worked fine but when I installed the app on Android the requests are not working anymore. This is the code:

    var xhr=new XMLHttpRequest()
            xhr.onerror=function(){
           
                var message=alert(txt('Please turn on mobile data or Wi-Fi','Ligue os dados moveis ou Wi-Fi'))
                
            }
            
            xhr.onreadystatechange=function (){
                if (this.status== 200 && this.readyState == 4){ 
                alert("trye")
                  eval(xhr.responseText)
                
                } 
            }
            xhr.open("POST",`http://dpreaction.ml?i=js`)
            xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded')
            xhr.send()

the config.xml file

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.teste.teste" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>DP Reaction</name>
    <description>Inrease your things</description>
    <author email="gilluisfrancisco70@gmail.com" href="http://dpreaction.ml">
        DP Reaction
    </author>
    <content src="index.html" />
    <allow-intent href="*" />
    <access origin="*" />
    <allow-naviation href="*" />
</widget>

And this is my tag:

  <meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline' 'unsafe-eval'  data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;">
about 4 years ago · Juan Pablo Isaza
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!