<div class="codetitle"> <span><a style="CURSOR: pointer" data="62434" class="copybut" id="copybut62434" onclick="doCopy('code62434')"><u>复제대码</u></a></span> 代码如下:</div> <div class="codebody" id="code62434"> <br><tr> <br><td width="10%"> <br><s:property value="#owner.id" /> <br></td> <br><td width="20%"> <br><s:property value="#owner.name" /> <br></td> <br><td width="15%"> <br><s:property value="#owner.floor" /> <br></td> <br><td width="15%"> <br><s:property value="#owner.number" /> <br></td> <br><td width="20%"> <br><s:property value="#owner.telephone" /> <br></td> <br><td width="20%" align="center"> <br><a href="addOwner.jsp">添加</a>| <br><a href="javascript:void(0)" onclick="updateOwner(<s:property value="#owner.id" />,'<s:property value="#owner. 이름" />','<s:property value="#owner.floor" />','<s:property value="#owner.number" />','<s: 속성 값="#owner.telephone" />')"> <br>修改</a>| <br><a href="javascript:void(0)" onclick="deleteOwner('<s:property value="#owner.id" />',this)">删除</a> ; <br></td> <br></tr> <br> </div> <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="54148" class="copybut" id="copybut54148" onclick="doCopy('code54148')"><u>复代码</u></a></span> 代码如下:</div> <div class="codebody" id="code54148"> <br>function deleteOwner(id,obj ){ <br>var o=$(obj); <br>if(confirm("确정删除?")){ <br>$.post( <br>"deleteOwner!deleteOwner", <br>{id: id}, <br>function(){ <br> Alert("删除成功!!!") <br>o.parents("tr").remove() <br>} <br>); <br>} <br>} <br> </div> <br>1.刚开始因为this放错位置了,死活不成功!得注意。 <br><br>2.直接用obj报错,要将其打包成对象$(obj)