本帖最后由 张向辉 于 2013-1-24 19:05 编辑
按照视频写的,找了半天找不出错误,求指出错误
<!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=utf-8" />
<title>无标题文档</title>
<style type="text/css">
table{
border:#096 1px solid;
width:100px;
border-collapse:collapse;
}
table td{
border:#00F 1px solid;
background-color:#FF3;
text-align:center;
}
table td div{
background-color:#CF9;
}
table td a:link,table td a:visited{
color:#F6C;
text-decoration:none;
}
table td a:hover{
color:#3F0;
}
table td div{
display:none;
}
.open{
display:block;
}
.close{
display:none;
}
</style>
<script type="text/javascript">
function list3(anode)
{
var tdNode = anode.parentNode;
var divNode = tdNode.getElementsByTagName("div")[0];
with(divNode)
{
if(className == "open")
{
className == "close";
}
else
{
className == "open";
}
}
/**/
var tabNode = document.getElementsByName("table")[0];
var divNodes = tabNode.getElementsByTagName("div");
for (var x=0; x<divNodes.length; x++)
{
if(divNodes[x]==divNode)
{
with(divNoeds[x])
{
if(className == "open")
{
className == "close";
}
else
{
className == "open";
}
}
}
else
divNodes[x].className = "close";
}
}
</script>
</head>
<body>
<table>
<tr>
<td>
<a href="javascript:void(0)">好友列表</a>
<div>
大土豆<br />
大土豆<br />
大土豆<br />
大土豆<br />
</div>
</td>
</tr>
<tr>
<td>
<a href="javascript:void(0)">好友列表</a>
<div>
大土豆<br />
大土豆<br />
大土豆<br />
大土豆<br />
</div>
</td>
</tr>
<tr>
<td>
<a href="javascript:void(0)">好友列表</a>
<div>
大土豆<br />
大土豆<br />
大土豆<br />
大土豆<br />
</div>
</td>
</tr>
<tr>
<td>
<a href="javascript:void(0)">好友列表</a>
<div>
大土豆<br />
大土豆<br />
大土豆<br />
大土豆<br />
</div>
</td>
</tr>
</table>
</body>
</html>
网页错误详细信息
用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727)
时间戳: Thu, 17 Jan 2013 07:33:31 UTC
消息: 'undefined' 为空或不是对象
行: 62
字符: 2
代码: 0
URI: file:///K:/java%20study/day28/list3.html
|