- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
- HTML5
- Intel® XDK
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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-ajax-and-launching-external-apps
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page