{
user: [
{
id: 476,
customer: {
id: "375",
name: "test",
avatar: null,
email: "test@test.com",
phone_number: "",
created_at: "2013-06-19 19:47:54.425111"
},
service: "test",
inst: "N/A",
images: [ ]
}]
}
如何在我的 jQuery 中打印上面的 json
我尝试跟随以获取json
$.getJSON('jobs.json', function(data) {
console.log(JSON.stringify(data);
});
这会返回 json 但是当我打印服务时它会抛出错误
$.getJSON('jobs.json', function(data) {
console.log(JSON.stringify(data.service[0]);
});
抛出错误为
Uncaught TypeError: Cannot read property '0' of undefined