$(document).ready(function() {
console.log(getJ());
function getJ() {
$.getJSON('json.json', function(data) {
$.each(data, function(key, val) {
console.log(key);
});
});
}
});
上面是我的 HTML 代码,下面是我的 json.json 文件的代码
{
"message": {
"success":"Information inserted successfully.",
"update":"Information updated successfully.",
"delete":"Information deleted successfully.",
},
"Jennifer": {
"status":"Active"
},
"James": {
"status":"Active",
"age":56,
"count":10,
"progress":0.0029857,
"bad":0
}
}
当我尝试解析这一堆代码时,它显示 304 消息,我没有得到任何所需的结果。