1
我嘗試開發一個小網站日曆。用戶獲得一週的概述,如果他推送「下週展示我」,那麼接下來的7天應該使用jQuery異步加載。 JSON數據如下所示:如何解析與jQuery的大JSON?
{
"user":[
{
"id":"12345",
"days":{
"09-07-2012":{
"10:00":{
"time":"10:00",
"length":"30",
"appointmentid":"159487"
},
"11:00":{
"time":"11:00",
"length":"30",
"appointmentid":"159487"
},
"12:00":{
"time":"12:00",
"length":"30",
"appointmentid":"159487"
}
},
"10-07-2012":{
"10:00":{
"time":"10:00",
"length":"30",
"appointmentid":"159487"
},
"11:00":{
"time":"11:00",
"length":"30",
"appointmentid":"159487"
},
"12:00":{
"time":"12:00",
"length":"30",
"appointmentid":"159487"
}
},
"11-07-2012":{
"10:00":{
"time":"10:00",
"length":"30",
"appointmentid":"159487"
},
"11:00":{
"time":"11:00",
"length":"30",
"appointmentid":"159487"
},
"12:00":{
"time":"12:00",
"length":"30",
"appointmentid":"159487"
}
}
}
}
]
}
我如何處理這些數據並將其顯示在html表中?使用jQuery功能我只能走拋出第二維...所以我只能得到ID和天...
$.each(data.user, function(i,data){
...
}
所以我怎麼能走扔掉整個數組,並填寫我的用戶界面與數據?我應該使用嵌套的每個功能?
電賀 托馬斯