欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

使用js聲明數(shù)組,對(duì)象在jsp頁(yè)面中(獲得ajax得到j(luò)son數(shù)據(jù))

 更新時(shí)間:2013年11月05日 10:11:49   作者:  
使用js聲明數(shù)組,對(duì)象在jsp頁(yè)面中(獲得ajax得到j(luò)son數(shù)據(jù))。需要的朋友可以過(guò)來(lái)參考下,希望對(duì)大家有所幫助

1、在jsp頁(yè)面的js中可以用jsp標(biāo)簽

var patientInfoList={patientId:"${session.patientId}"};
var docDepList=[],noTypeMap=["","普通號(hào)","主治醫(yī)生號(hào)","副主任醫(yī)師號(hào)","主任醫(yī)師號(hào)"];

<c:forEach varStatus="idx" var="list" items="${docDepList}">
 docDepList[${idx.index}]={doctorId:"${list.doctorId}",departmentName:"${list.departmentName}"};
</c:forEach>

docDepList是一個(gè)數(shù)組,在js賦值是里邊可以是對(duì)象

patientInfoList是一個(gè)對(duì)象

2、如果ajax傳過(guò)來(lái)的值是

復(fù)制代碼 代碼如下:

{"birthday":"1977-07-08","contactInfoList":[],"gender":"男"}形式可以用eval("("+data+")").birthday獲得birthday的值
[{"contactInfo_ID":0,"create_Time":""create_Time}]形式相當(dāng)于一個(gè)數(shù)組可以用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<dataArr.length;i++){

alert(dataArr[i].create_Time);


}

您可能感興趣的文章:

相關(guān)文章

最新評(píng)論