日期:2014-05-17 浏览次数:20775 次
<c:forEach items="${sessionScope.products }" var="p" varStatus="s">
<tr>
<td>${p.pid }</td>
<td>${p.pname }</td>
<td>${p.pcontext }</td>
<td><a href="javascript:showupd(${p })"onclick="">修改</a>|<a href="javascript:showdel()">删除</a></td>
</tr>
</c:forEach>
function showupd(${p}){
alert("p");
//alert(p.pid);
document.getElementById("div_upd").style.display="";
document.getElementById("div_upd").style.top=y+"px";
document.getElementById("div_upd").style.left=x+25+"px";
}
<c:forEach items="${sessionScope.products }" var="p" varStatus="s">
<tr>
<td>${p.pid }</td>
<td>${p.pname }</td>
<td>${p.pcontext }</td>
<td><a href="javascript:showupd(${p.pid },${p.pname },${p.pcontext })"onclick="">修改</a>
------解决方案--------------------
<a href="javascript:showdel()">删除</a></td>
</tr>
</c:forEach>
function showupd(pid,pname,pcontext){
alert(pid);
alert(pname);
alert(pcontext);
document.getElementById("div_upd").style.display="";
document.getElementById("div_upd").style.top=y+"px";
document.getElementById("div_upd").style.left=x+25+"px";
}