{
'lastChangedName': null'Caption': 'Adhesive Tape',
'CreateByID': 0,
'DateOnSet': '02/10/2011',
'Note': 'Currently participating in Allergy shots to resolve this',
'Reaction': 'skin rash',
'SectionDescription': 'Allergy List',
'HistoryItemID': 1831,
'CurrentInDrFirst': 0,
'CreateDate': '/Date(1297674300000-0500)/',
'Code': '3746',
'PL': '1',
'Problem': {
"LastChargedByUserID": 0,
"LastChargedDate": null,
"ProblemStatus": 1003,
"DateResolved": "12\/2\/11",
"PatientID": 0,
"ProblemID": 1330
},
'CategoryDescription': null,
'CategoryID': 0,
'CodeSystem': 'FDBDRUG',
'SectionID': 3,
'LastChangedID': 0,
},
{
'lastChangedName': null'Caption': 'Cats',
'CreateByID': 0,
'DateOnSet': '6/4/1997',
'Note': '0',
'Reaction': 'Sneezing',
'SectionDescription': 'Allergy List',
'HistoryItemID': 1925,
'CurrentInDrFirst': 0,
'CreateDate': '/Date(1299176220000-0500)/',
'Code': '',
'PL': '1',
'Problem': {
"LastChargedByUserID": 0,
"LastChargedDate": null,
"ProblemStatus": 1002,
"DateResolved": null,
"PatientID": 0,
"ProblemID": 1331
},
'CategoryDescription': null,
'CategoryID': 0,
'CodeSystem': '',
'SectionID': 3,
'LastChangedID': 0,
}
这是我得到的回应,我想遍历并打印出标题值...在一个文本框中...迭代这种反应
for each(var item in response) {
alert(item.caption)
}
仅打印我的第一个标题单独。
“ 'lastChangedName':null'Caption”:“ - 不两个实例中都缺少逗号? – symcbean
'对于每个(var item in response){'不是有效的JavaScript。使用'for(var item in response){'来代替。 –