28,409
社区成员




function getTD(o){
do{
if(o.tagName=="TD")return o;
o=o.parentNode;
}while(o);
}
table.ondblclick=function(e){//给table加一个ondblclick就行了~
e=e||event;
var o=e.srcElement||e.target,td=getTD(o),tr=td.parentNode;
alert(tr.cells[0].innerHTML);//第一个单元格
window.location='s_Edit.asp?id='+tr.cells[0].innerHTML
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script>
function sb(id){
window.location.href = "2.asp?id=" + id;
}
</script>
</head>
<body>
<table width="50" border="0" cellspacing="0" cellpadding="0">
<tr onclick="sb('20070101');">
<td>11111111111111111111</td>
</tr>
<tr onclick="sb('20070102');">
<td>222222222222222</td>
</tr>
</table>
</body>
</html>
<%
id = int(Request("id"))
If id <>"" Then
If id = "20070101" Then
Response.Redirect("http://www.qq.com")
End If
If id = "20070102" Then
Response.Redirect("http://www.163.com")
End If
Else
Response.Redirect("http://www.baidu.com")
End If
%>