1. You can use the jsp tag
in the js of the jsp page
var patientInfoList={patientId:"${session.patientId}"};
var docDepList=[],noTypeMap=["","Normal number" ,"Attending physician number","Deputy chief physician number","Chief physician number"];
idx" var="list" items="${docDepList}">
docDepList [${idx.index}]={doctorId:"${list.doctorId}",departmentName:"${list.departmentName}"} ;
docDepList is an array, which can be an object in js assignment
patientInfoList is an object
2. If the value passed by ajax is
{"birthday":"1977-07-08","contactInfoList":[],"gender":"male"} can be obtained by using eval("(" data ")").birthday The value of birthday
[{"contactInfo_ID":0,"create_Time":""create_Time}] is equivalent to an array and can be obtained using eval("(" data ")")[0].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);
}