Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Theo_v_
Beginner
58 Views

Problem AJAX call in ios build

Hi,

Whenever I build my project for iOS and install it on a iphone the ajax call below fails silently (no alerts).
In a mobile browser  on the same device it works fine though. JQuery is initialised correctly, any suggestions?

Thanks!

var jqxhr = $.ajax({
            method: "POST",
            url: "http://192.168.0.2:9292/db.php",
            crossDomain: true,
            data: { action: "doSomething"},
            error: function(){
                console.log(data);
                alert('There was an error');
            }
        } )
        .done(function(result) {
            alert ("COMPLETE!");
        })
        .fail(function(request, status, error) {
            alert  ( "error loading data" );
        })

 

 

 

Tags (2)
0 Kudos
1 Reply
Theo_v_
Beginner
58 Views

AJAX calls are blocked by default
I forgot to white-list the domain in the IOS Build settings:
https://software.intel.com/en-us/xdk/articles/cordova-cli-412-domain-whitelisting-with-intel-xdk-for...

 

Reply