0

我正在尝试在我的 phonegap 应用程序中解析 json 文件。在 Stackoverflow 上搜索后,我发现了这段代码

这是我的代码

  $.getJSON('http://shobingg.com/cms/sites/php/message.json',
  function(data)
  {    
      $.each(data, function(i, item) {
          alert (item.message);
      });
      //$("#div-my-table").append("</table>");
  });

你可以从这里看到原来的帖子

我的代码有什么问题?

4

1 回答 1

0

尝试这个:

$(document).ready(function() {
    var url =  "http://www.shobingg.com/cms/sites/php/message.json";
    $.getJSON(url + "?callback=?", null, function(data) {
        console.log(data);
    });
});

jsonp 和 jquery引用

于 2013-05-11T06:03:53.273 回答