js求助
<script language="javascript"> var xmlHttp; var tempEmpno; function deleteCheck(empno,photo) { if(window.confirm("确认删除此条记录吗?")) { deleteEmp(empno,photo); } else { return false; } } function deleteEmp(empno,photo) { if(window.XMLHttpRequest) { xmlHttp=new XMLHttpRequest(); } else { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } tempEmpno=empno; xmlHttp.open("POST", "EmpServlet?status=deleteEmp&empno="+empno+"&photo="+photo); xmlHttp.onreadystatechange=deleteEmpCallBack; xmlHttp.send(null); } function deleteEmpCallBack() { if(xmlHttp.readyState==4&&xmlHttp.status==200) { if(xmlHttp.responseText=="true") { alert("删除成功!"); var tr=document.getElementById("tr-"+tempEmpno); tr.parentNode.removeChild(tr); } else { alert("删除失败!"); } } } </script>
<th><a href="#" onclick="return deleteCheck(${emp.empno},${emp.photo})">删除</a></th>