我正在为ios开发一个应用程序框架+ phonegap构建应用程序。当带有id #item1 1的面板加载时,我不希望本地获取数据并将其写入页面。我用这个:
$('#item1').on("loadpanel", function(){
$.ajax({
type:"GET",
url:"data/mydata.json",
contentType:"application/json",
success:function(data){
console.log(data.cat);
alert(data.cat);
$.ui.setTitle(data.cat);
$.each(data.entries, function( index, value ) {
$('ul.list').append('<li data-filter="' + value.title + '"><a href="#details/'+ index +'/1">' + value.title + '</a></li>')
});
$(".list").filterList();
},
error: function (xhr, ajaxOptions, thrownError) {
alert("errorstatus: " + xhr.status + " ajaxoptions: " + ajaxOptions + " throwError: " + thrownError);
}
});
}); 这在浏览器中运行得很好,但是当我使用phonegap构建打包用于ios的应用程序时,没有任何东西被附加到页面上,警报语句显示没有定义。这可能与config.xml中的phonegap访问标记有关,所以我也会在这里粘贴它们:
<access origin="*" />
<access origin="*"/>所有的帮助都非常感谢!
发布于 2014-05-08 13:38:32
https://stackoverflow.com/questions/23542707
复制相似问题