Hi, I am creating an iOS application via Cordova (5.1.1) / Phonegap and I have a problem that I cannot solve.
The main Ajax call is thrown by a SecurityError: DOM Exception 18 I tried all the tricks regarding the whitelist, and now I'm lost. Who can help? Thank you
Here is what I do after the device is ready:
var getUrl = 'http://shopplo.com/api/posts/radius/'+app.lat_min+'x'+app.lat_max+'x'+app.lng_min+'x'+app.lng_max+''; //console.log(getUrl); var getPosts = $.ajax({ method: 'GET', url: getUrl, dataType: 'JSON' }) .done(function(e) { console.log( e ); }) .fail(function(e) { //console.log( "error"); $.each(e, function(key, element) { console.log('key: ' + key + '\n' + 'value: ' + element); }); }) .always(function() { console.log( "complete" ); });
getUrl: http://shopplo.com/api/posts/radius/37.11032230061141x73.11032230061141x-20.572796183027627x42.36447502674581
And I get:
2015-07-20 01:12:55.981 ShopploLight[779:568632] key: responseJSON :: value: undefined 2015-07-20 01:12:55.983 ShopploLight[779:568632] key: status :: value: 0 2015-07-20 01:12:55.983 ShopploLight[779:568632] key: statusText :: value: Error: SecurityError: DOM Exception 18 2015-07-20 01:12:55.984 ShopploLight[779:568632] complete
source share