<html>
<head>
<title>书籍查询</title>
</head>
<body>
<script language="JavaScript" for="window">
var xmldoc=new ActiveXObject("MSXML.DOMDocument");
xmldoc.async="false";
xmldoc.load("books.xml");
function FindCorp()
{
SearchString = SearchText.valus;
if (SearchString == "")
{
alert ("请输入要查询的书籍编号");
return;
}
Result="";
for(i=0;i<xmldoc.documentElement.childNodes.length;i++)
{
CorpString=xmldoc.documentElement.childNodes(i).childNodes(0).text;
if (CorpString == SearchString)
Result +=
xmldoc.documentElement.childNodes(i).childNodes(0).text+",</B>"
+xmldoc.documentElement.childNodes(i).childNodes(1).text+"</B>,"
+xmldoc.documentElement.childNodes(i).childNodes(2).text+","
+xmldoc.documentElement.childNodes(i).childNodes(3).text+","
+xmldoc.documentElement.childNodes(i).childNodes(4).text+","
+xmldoc.documentElement.childNodes(i).childNodes(5).text+","
+xmldoc.documentElement.childNodes(i).childNodes(6).text+","
+xmldoc.documentElement.childNodes(i).childNodes(7).text+"<P>";
}
if (Result == "")
alert("查无此学生");
else
ResultDiv.innerHTML=Result
}
</script>
<h2>学生查询</h2>
请输入学号:<INPUT TYPE="TEXT" ID="SearchText">
<button onclick="FindCorp()">查询</button>
<hr>
查询结果:<p>
<DIV ID=ResultDiv></DIV>
</body>
</html>
哪位大佬给我看一下,这是哪的毛病,然后怎么改
谢谢了
<head>
<title>书籍查询</title>
</head>
<body>
<script language="JavaScript" for="window">
var xmldoc=new ActiveXObject("MSXML.DOMDocument");
xmldoc.async="false";
xmldoc.load("books.xml");
function FindCorp()
{
SearchString = SearchText.valus;
if (SearchString == "")
{
alert ("请输入要查询的书籍编号");
return;
}
Result="";
for(i=0;i<xmldoc.documentElement.childNodes.length;i++)
{
CorpString=xmldoc.documentElement.childNodes(i).childNodes(0).text;
if (CorpString == SearchString)
Result +=
xmldoc.documentElement.childNodes(i).childNodes(0).text+",</B>"
+xmldoc.documentElement.childNodes(i).childNodes(1).text+"</B>,"
+xmldoc.documentElement.childNodes(i).childNodes(2).text+","
+xmldoc.documentElement.childNodes(i).childNodes(3).text+","
+xmldoc.documentElement.childNodes(i).childNodes(4).text+","
+xmldoc.documentElement.childNodes(i).childNodes(5).text+","
+xmldoc.documentElement.childNodes(i).childNodes(6).text+","
+xmldoc.documentElement.childNodes(i).childNodes(7).text+"<P>";
}
if (Result == "")
alert("查无此学生");
else
ResultDiv.innerHTML=Result
}
</script>
<h2>学生查询</h2>
请输入学号:<INPUT TYPE="TEXT" ID="SearchText">
<button onclick="FindCorp()">查询</button>
<hr>
查询结果:<p>
<DIV ID=ResultDiv></DIV>
</body>
</html>
哪位大佬给我看一下,这是哪的毛病,然后怎么改
谢谢了