嗨,我正在通过Cordova(5.1.1)/ Phonegap构建iOS应用程序,但有一个我无法解决的问题。
一个基本的Ajax电话抛出一个问题,SecurityError: DOM Exception 18我尝试了所有有关白名单的技巧,但现在我迷路了。有谁可以帮助您?谢谢。
准备好设备后,我会执行以下操作:
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" );
});
Run Code Online (Sandbox Code Playgroud)
getUrl是:http : //shopplo.com/api/posts/radius/37.11032230061141x73.11032230061141x-20.572796183027627x42.36447502674581
我得到:
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: …Run Code Online (Sandbox Code Playgroud)