{
user: [
{
id: 476,
customer: {
id: "375",
name: "test",
avatar: null,
email: "[email protected]",
phone_number: "",
created_at: "2013-06-19 19:47:54.425111"
},
service: "test",
inst: "N/A",
images: [ ]
}]
}
如何打印上面的JSON在我的jQueryJSON響應
我嘗試以下,以獲得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
他想打印在警報 –
一個右括號丟失。請編輯。 – Mowji