当前位置: 代码迷 >> J2EE >> onclick 跳转 双击表格任一行,获取该行所有列的值 并且如何把值传递给frameset设定的另外一个frame
  详细解决方案

onclick 跳转 双击表格任一行,获取该行所有列的值 并且如何把值传递给frameset设定的另外一个frame

热度:545   发布时间:2016-04-22 02:22:34.0
onclick 跳转 双击表格任一行,获取该行所有列的值 并且怎么把值传递给frameset设定的另外一个frame
<%@ page language="java" import="java.util.*"
import="com.goods.dao.*,com.goods.good.*,com.goods.goodinterface.*,com.goods.goodmanageimpl.*"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>

<%
GoodManage gm = new GoodManageImpl();
List<Good> goodlist = new ArrayList<Good>();
goodlist = gm.getAllGood();
session.setAttribute("goodlist", goodlist);
%>
<html>
<head>
<script language="javascript" type="text/javascript">
 function showdetail(element)
 {
  alert("jiang");//这里该怎么写?
 }
</script>
</head>
<body background="img/sky.jpg">

<table align="center" border="1" width="600" height="400" id="tableId"
background="img/back.jpg">
<tr >
<th>
商品ID
</th>
<th>
商品名
</th>
<th>
商品价格
</th>
<th>
商品产地
</th>
<th>
商品类型
</th>
<th>
商品厂家
</th>
</tr>
<c:forEach var="good" items="${goodlist}" >
<tr id="tid" onclick="showdetail(this)" onmouseout= "this.style.background='#FFFFFF'" onmouseover= "this.style.background= 'BDDFFF ' ">
<td align="center">

<c:out value="${good.goodid}"></c:out>

</td>
<td align="center">
<c:out value="${good.goodname}"></c:out>
</td>
<td align="center">
<c:out value="${good.goodprice}"></c:out>
</td>
<td align="center">
<c:out value="${good.goodaddr}"></c:out>
</td>
<td align="center">
<c:out value="${good.goodtype}"></c:out>
</td>
<td align="center">
<c:out value="${good.goodfactory}"></c:out>
</td>
</tr>
</c:forEach>
</table>
</body>
</html>


------解决方案--------------------
table 应该有rowid 属性吧!你查查javascript 文档看看!
  相关解决方案