用Jquery解析Json文件?不工作 [英] Parse Json file with Jquery ? not working
本文介绍了用Jquery解析Json文件?不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在我的phonegap应用程序中解析json文件。在搜索Stackoverflow后,我发现这个代码
I am trying to parse json file in my phonegap application. after searching on Stackoverflow I found this code
这里是我的代码
$.getJSON('http://shobingg.com/cms/sites/php/message.json',
function(data)
{
$.each(data, function(i, item) {
alert (item.message);
});
//$("#div-my-table").append("</table>");
});
您可以从这里
我的代码有什么问题?
推荐答案
尝试:
$(document).ready(function() {
var url = "http://www.shobingg.com/cms/sites/php/message.json";
$.getJSON(url + "?callback=?", null, function(data) {
console.log(data);
});
});
这篇关于用Jquery解析Json文件?不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文