说句实话,我也没有弄懂。哎,留着自己看吧
<script type="text/javascript" >
$(document).ready(function(){
$("#table1 > tbody > tr").click(function(){
alert(this.rowIndex);
var id=this.rowIndex;
getId(id);
});
});
function getId(id){
var tab=document.getElementById("table1");
fromid=tab.rows[1].cells[0].innerHTML;
toId(id);
}
function toId(id){
//window.location.href="http://dealMess.jsp?messageid="+id;
// window.open("<%=basePath%>dealMess.jsp?messageid="+id )
window.open("<%=basePath%>/message/getMessinfo.do?messageid="+id )
}
</script>
表格部分:
<table class="table-striped table-hover table-bordered table" id="table1">
<tr class="info" >
<td>发送人</td>
<td>发送时间</td>
<td>发送内容</td>
<td>发送类型</td>
<td>操作</td>
</tr>
<c:forEach items="${mesList}" var="messageinfo">
<tr>
<td style="display: none;" id="fromid" width= "110px">${messageinfo.formid}</td>
<td width= "110px">${messageinfo.username}</td>
<td width="110px">${messageinfo.senddate}</td>
<td width="110px">${messageinfo.content}</td>
<td width="110px">${messageinfo.typedesc}</td>
<td width="110px"><a onclick="getfromId()" style="cursor: point">处理</a></td>
</tr>
</c:forEach>
</table>