以下是我的JSON輸出:檢索多維數組數組中的JSON
{
"BILLINGINFO": [
{
"CUST_REQ_BILL_DATE": "15",
"BILL_MONTH": "03",
"CONSOLIDATION_CRITERIA": "016",
"CONSOLIDATION_OPTION": "A",
"SPLIT_LINES": "",
"BILL_IN_ARREARS": "X",
"BILL_CREATE_DATE": "02"
}
],
"DROPDOWNS": [
{
"FIELD": "CUST_REQ_BILL_DATE",
"VALUE": "01",
"TEXT": "1st of month"
},
{
"FIELD": "CUST_REQ_BILL_DATE",
"VALUE": "02",
"TEXT": "2nd of month"
}
]
}
我仍然learming jQuery和不知道如何以檢索BILLINGINFO和下拉式陣列的值。
+1此外,您可以使用'obj ['BILLINGINFO']'和'obj ['DROPDOWN']'。 – mellamokb 2013-04-22 17:58:44
@mellamokb True,但是http://stackoverflow.com/questions/4968406/javascript-property-access-dot-notation-vs-brackets。我仍然將它添加到 – Ian 2013-04-22 18:00:49
其實,下拉數組是爲組合框值,我需要通過它循環。我正在使用它,但它給出了「無法讀取屬性'長度的'未定義的錯誤:$ .each(data.dropdowns,function(index){0} {('#conscrit')。append(''); }); – user1596433 2013-04-22 18:06:16