我有个问题。我需要访问 jQuery 数组中的对象。
我的json:
{"employ": [
{
"id": 46846,
"name": "some name",
"schedule": "main",
"hours": {
"11.09.2012": 5,
"12.09.2012": 8
}
}
,
{
"id": 3543,
"name": "another name",
"schedule": "main",
"hours": {
"11.09.2012": 9,
"12.09.2012": 7
}
}
]}
还有我的jQuery:
$(document).ready(function(){
$("#click").click(function(){
$.getJSON('employ.json', {}, function(json){
$("#userid").append(json.employ[0].hours.????);
});
})
});
我需要什么代码在“???”的地方 访问名称为“11.09.2012”的元素?