<html>
<head>
<title>联系</title>
<script language="javascript" type="text/javascript">
var i=0;
var item = 0;
var yellowBook = new Array();
function add(){
yellowBook[i] = new Array(4)
fm = document.forms[0]
yellowBook[i][0] = fm.elements[0].value
yellowBook[i][1] = fm.elements[1].value
yellowBook[i][2] = fm.elements[2].value
yellowBook[i][3] = fm.elements[3].value
i++
fm.elements[0].value=
fm.elements[1].value=
fm.elements[2].value=""
fm.elements[3].value=""
item++
}
function del(j){
item--
yellowBook[j][0] = null
newWin.close()
show()
}
function show(){
newWin = open("","","height=300,width=400")
with(newWin.document){
write("工有",item,"条数据")
write("<table border>")
write("<tr><th>姓名<th>学号<th>地址<th>爱好<th>")
for(var j =0;j<yellowBook.length;j++)
if(yellowBook[j][0]!=null){
write("<tr><td>",yellowBook[j][0],"<td>",yellowBook[j][1],"<td>",yellowBook[j][2],"<td>",yellowBook[j][3],"<td>","<a href=javascript:opener.del("j")>删除</a>")
}
write("</table>")
write("<input type ='button' value='关闭窗口'","onClick=self.close()>")
}
}
</script>
</head>
<body>
<form>
姓名:<input type="text" /><br />
学号:<input type="text" /><br />
地址:<input type="text" /><br />
爱好:<input type="text" /><br />
<input type="button" value="加入通讯录" onclick= add() />
<input type="button" value="显示所有数据" onclick= show() />
</form>
</body>
</html>
检查多次未发现错在何处?