1

我是 phonegap 和 javascript 的新手,我遇到了问题。我有一个 URL 来下载包含一些图片的 JSON 文件。我尝试了这些方法:

$.ajax({
    url: 'myurl.json',
    type: 'get',
    dataType: 'json',
    success: function(data) {
        alert("Read json");
    },
    error: function() {
        alert("Error");
    }
});
$.get("myurl.json", function(data) {
    alert("alert");
}, "json");
$.get("myurl.json", function(data) {
    alert("alert");
});
$.getJSON("myurl.json", function(data) {
    alert("alert");
});

他们在 Android 2.x 中工作,但在 Android 4.x 中响应是null. 在 Android 4.x 中,我在 LogCat 上有此错误:

06-03 10:25:34.205: I/Choreographer(2795): Skipped 43 frames! The application may be doing too much work on its main thread.

当它失败时, textStatus 返回parsererror

你可以帮帮我吗?谢谢。

4

0 回答 0