一关键:在(susp_cancel_query)中: 隐藏了下面的内容。
在下面的代码里,定义了各个id。然后去通过getElementById去取
<tr style="display: none" id="<c:out value='${map.bkxh}'/>" >
<td colspan="7">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="line_table">
<tr><td class="red rit" width="15%">撤控原因:</td><td colspan="5"><c:out value="${map.ckyyms}" /></td></tr>
<tr>
<td class="red rit" width="15%">报警优先级:</td> <td width="15%" id="yxj<c:out value='${map.bkxh}'/>"> </td>
<td class="red rit" width="15%">车身颜色:</td> <td width="20%" id="csys<c:out value='${map.bkxh}'/>"> </td>
<td class="red rit" width="15%">车辆品牌:</td> <td width="20%" id="clpp<c:out value='${map.bkxh}'/>"> </td>
</tr>
<tr>
<td class="red rit">车辆特征:</td> <td id="cltz<c:out value='${map.bkxh}'/>"> </td>
<td class="red rit">布控人员:</td> <td id="bkr<c:out value='${map.bkxh}'/>"> </td>
<td class="red rit">联系方式:</td> <td id="bkrlxfs<c:out value='${map.bkxh}'/>"> </td>
</tr>
<tr>
<td class="red rit">短信号码:</td> <td id="dxhm<c:out value='${map.bkxh}'/>"> </td>
<td class="red rit">处置方式:</td> <td id="czfs<c:out value='${map.bkxh}'/>" colspan="3"> </td>
</tr>
<tr>
<td class="red rit">简要案情:</td> <td id="jyaq<c:out value='${map.bkxh}'/>" colspan="5"> </td>
</tr>
<tr>
<td class="red rit">车辆图片:</td>
<td><div id="img<c:out value='${map.bkxh}' />"><img id="preview<c:out value='${map.bkxh}' />" src="<%=imgPath%>/indicator_medium.gif" />图片加载中...</div></td>
</tr>
</table>
</td>
</tr>
<td><div id="img<c:out value='${map.bkxh}' />"><img id="preview<c:out value='${map.bkxh}' />" src="<%=imgPath%>/indicator_medium.gif" />图片加载中...</div></td>
这里有两个id: 分别是img这个id和 preview这个id.
对应代码:(preview这个id)
document.getElementById('mz'+xh).innerHTML=(data.mz==null?" ":data.mz);
document.getElementById('csrq'+xh).innerHTML=(data.csrq==null?" ":data.csrq);
document.getElementById('ksrq'+xh).innerHTML=(data.ksrq==null?" ":data.ksrq);
document.getElementById('jsrq'+xh).innerHTML=(data.jsrq==null?" ":data.jsrq);
document.getElementById('bm'+xh).innerHTML=(data.bm==null?" ":data.bm);
document.getElementById('fjxx'+xh).innerHTML=(data.fjxx==null?" ":data.fjxx);
document.getElementById('zjdz'+xh).innerHTML=(data.zjdz==null?" ":data.zjdz);
document.getElementById('cjmj'+xh).innerHTML=(data.cjmj==null?" ":data.cjmj);
(img这个id):
if(data.num==0){
document.getElementById(id).innerHTML='无';
}else if(data.num==1){
document.getElementById(id).innerHTML='<img title ="点击查看原始图片" style="cursor:hand" οnclick="openImgWindow(/'<%=contextPath%>/navigate.do?act=zoomImg&ImgAreaName=pic1/');" src="<%=contextPath%>/servlet/ShowPic?type=0&key=xlh&keyValue='+xh+'&field=tp&table=personcheck" width="325px" height="250px" id="pic1" name="pic1" />';
}