我很努力让我的$ .getJSON在jQuery移动中启动。我已经试过在jQuery加载之后和jQueryMobile之前调用它无济于事。jQueryMobile - JSON请求
$(document).ready
$(document).bind("mobileinit"
等
这里是我:我还处于起步尝试像不同的功能。第一个警报运行,但它在到达JSON部分时似乎停止。
$(document).bind("mobileinit", function(){
$('#home_screen').live('pagecreate',function(event) {
alert('Loaded'); // Runs fine
$.getJSON('includes/data/get.php',{'request_type':'count'}, function(data) {
$.each(data, function(i, item) {
alert(2);
});
});
});
});
萤火虫说什么?任何错误?你可以尝试一条绝对路径吗? '/ includes/data/get.php' – Niels
它在Firefox中完美运行。当我将它加载到我的iPhone上时,它不会这样做。我在JSON之后添加了另一个警报,它似乎完全跳过了JSON部分。 –