当用户单击 div 时将数据发送到新的 jsp
<form action="" method="get" enctype="application/x-www-form-urlencoded">
<h3>Current Users</h3>
<c:if test="${!empty pagedListHolder}">
<div class="data">
<div class="dataContent">
<div class="dataText">
<div class="dataText1">Name</div>
<div class="dataText2">Email</div>
<div class="dataText3">Last Seen</div>
</div>
<c:forEach items="${pagedListHolder.pageList}" var="user">
<div class="dataName">
<div class="dataName1">${user.name}</div>
<div class="dataName2">${user.email}</div>
<div class="dataName3">Last Seen</div>
</div>
</c:forEach>
</div>
<div class="pagination">
<tg:paging pagedListHolder="${pagedListHolder}"
pagedLink="${pagedLink}" />
</div>
</div>
</c:if>
</form>
现在我想要的是当用户单击 div 时将数据发送到新的 jsp 中。 我怎样才能做到这一点。请建议。以前我使用
代替
,<c:forEach items="${pagedListHolder.pageList}" var="user">
<tr onmouseover="ChangeColor(this, true);" onmouseout="ChangeColor(this, false);" onclick="DoNav('${pageContext.request.contextPath}/secure/detailUserView/${user.id}');">
<td>${user.name}</td>
<td>${user.email}</td>
<td>${user.email}</td>
</tr>
</c:forEach>
</table>
</c:if>
现在我想用 div 做同样的事情。请建议。
<form action="" method="get" enctype="application/x-www-form-urlencoded">
<h3>Current Users</h3>
<c:if test="${!empty pagedListHolder}">
<div class="data">
<div class="dataContent">
<div class="dataText">
<div class="dataText1">Name</div>
<div class="dataText2">Email</div>
<div class="dataText3">Last Seen</div>
</div>
<c:forEach items="${pagedListHolder.pageList}" var="user">
<div class="dataName">
<div class="dataName1">${user.name}</div>
<div class="dataName2">${user.email}</div>
<div class="dataName3">Last Seen</div>
</div>
</c:forEach>
</div>
<div class="pagination">
<tg:paging pagedListHolder="${pagedListHolder}"
pagedLink="${pagedLink}" />
</div>
</div>
</c:if>
</form>
Now what i want is to send data into a new jsp when user click on a div.
How can i do this. please suggest. previously in place of <div>
i was using <td>
, than i was able to do it in this way
<c:forEach items="${pagedListHolder.pageList}" var="user">
<tr onmouseover="ChangeColor(this, true);" onmouseout="ChangeColor(this, false);" onclick="DoNav('${pageContext.request.contextPath}/secure/detailUserView/${user.id}');">
<td>${user.name}</td>
<td>${user.email}</td>
<td>${user.email}</td>
</tr>
</c:forEach>
</table>
</c:if>
Now i want same with div. please suggest.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的
需要一个处理程序来处理像您的
那样的点击:
解决方案:
Your
<div class="dataName">
needs a handler for clicks like your<tr>
had:Solution: