Use js to declare an array. The object is in the jsp page (obtain json data from ajax ). For more information, see.
1. jsp labels can be used in jsp page js
Var patientInfoList = {patientId: "$ {session. patientId }"};
VarDocDepList = [], NoTypeMap = ["", "General", "attending doctor", "Deputy Chief Physician", "Chief Physician"];
DocDepList[ $ {Idx. index}] = {DoctorId: "commandid list.doc torId}", departmentName: "$ {list. departmentName }"};
DocDepListIs an array, and the js value assignment can be an object.
PatientInfoListIs an object
2. If the value passed by ajax is
The Code is as follows:
{"Birthday": "1977-07-08", "contactInfoList": [], "gender": "male"} can use eval ("(" + data + ")"). returns the value of birthday.
[{"ContactInfo_ID": 0, "create_Time": "" create_Time}] is equivalent to an array. You can use eval ("(" + data + ")") [0]. get create_Time
[{"ContactInfo_ID": 0, "create_Time": "" create_Time}, {"contactInfo_ID": 0, "create_Time": "" create_Time}], {"contactInfo_ID ": 0, "create_Time": "" create_Time}, {"contactInfo_ID": 0, "create_Time": "" create_Time}]
Var dataArr = eval ("(" + data + ")");
For (var I = 0; I
Alert (dataArr [I]. create_Time );
}