以文本方式查看主题

-  堕落街论坛  (http://duoluojie.1314179.com.cn:443/index.asp)
--  游戏体育  (http://duoluojie.1314179.com.cn:443/list.asp?boardid=331)
----  HELP  (http://duoluojie.1314179.com.cn:443/dispbbs.asp?boardid=331&id=34839)

--  作者:秋思草堂
--  发布时间:2004/7/23 12:17:00
--  HELP

做了个站内检索,但不和出了什么错,请看如下代码:

<html> <head> <title>站内搜索</title> <style type="text/css"> <!-- p{font:9pt"宋体";text-decoration:none} td{font:9pt"宋体";text-decoration:none} a{font:9pt"宋体";text-decoration:none} body{font:9pt"宋体";text-decoration:none} .pt9{font:"宋体";text-decoration:none} --> </style> <meta http-equiv="content-type" content="text/html;charset=gb2312"> <script language="javascript"> <!-- function doInstructions(){ instructions=window.open("","instructions","toolbar=no,location=0,directories=0,status=no,menubar=0,scrollbars=yes,resizable=0,copyhistory=0,width=300,height=360"); instructions.document.writeln(\'<center><font size=+2>检索秘决</font></center>\'); instructions.document.writeln(\'<hr width=75%>\'); instructions.document.writeln(\'<font size=-1><ul type="disc">\'); instructions.document.writeln(\'<li>在检索框内输入关键字,请使用小写字符或中文。\'); instructions.document.writeln(\'<li>单击查询按钮开始查询。\'); instructions.document.writeln(\'<li>单击清除按钮可以清除输入的字符。\'); instructions.document.writeln(\'<li>由于数据库随时更新,如果你以前来过这里,请记得\'); instructions.document.writeln(\'<li>感谢光临,有问题来信询问 qiuqiongzhi@163.com\'); instructions.document.writeln(\'<li>http://www.tourism.bak.cn\'); instructions.document.writeln(\'</ul></font>\'); } //--> </script> <!--检索秘决代码结束> </head><body bgcolor="#000000" link="#0000ff" vlink="#800080"> <center> <script language="javascript"> <!-- var key=""; function makeEntry() { this.Name=""; this.URL=""; this.Desc=""; this.Category=""; this.Target=""; return this; } function makeArray(n) { this.length=n; for (var k=1;k<=n;k++){ this[k]=""; } return this; } function makeLinks(size){ this.length=size; for(var r=1;r<size;r++){ this[r]=new makeEntry(); this[r].Name=namesArray[r]; this[r].URL=urlsArray[r]; this[r].Desc=descArray[r]; this[r].Category=categoryArray[r]; this[r].Target=targetArray[r]; } return this; } var linksize=0 datesArray=new makeArray(linksize); namesArray=new makeArray(linksize); urlsArray=new makeArray(linksize); descArray=new makeArray(linksize); categoryArray=new makeArray(linksize); targetArray=new makeArray(linksize); var arraycount=0 <!-- 以下是数据库部分,自己模仿格式随意添加。--> arraycount +=1 urlsArray[arraycount]="http://www.nicrosoft.com" namesArray[arraycount]="Microsoft Home Page" descArray[arraycount]="The Home of Bill Gages empire" targeArray[arraycount]="target=_blank" <!--------数据库结束-------------> <!--------以下是输出的结果--------> function searchLinks(links,keyword){ document.write("<body bgcolor=\'#ffffff\' text=\'#000000\' link=\'#0000ff\' vlink=\'#80080\'>"); document.write("搜索关键字结果:<strong>"+keyword+"</strong><br><br>"); for (var q=1;<=links.length;q++){ if(links[q].URL.toLowerCase().indexOf(keyword)!=-1){ document.write("<a href="+links[q].URL+""+links[q].Target+">"+links[q].Name+"</a>-"); document.write(links[q].Category+"<br><br>"); continue; } if(links[q].Desc.toLowerCase().indexOf(keyword)!=-1){ document.write("<a href="+links[q].URL+""+links[q].Target+">"+links[q].Name+"</a>-"); document.write(links[q].Category+"<br><br>"); continue; if(links[q].Name.toLowerCase().indexOf(keyword)!=-1){ document.write("<a href="+links[q].URL+""+links[q].Target+">"+links[q].Name+"</a>-"); document.write(links[q].Category+"<br><br>"); continue; } } } //--> </script> <noscript>Sorry.you must have ajavascript enabled brower.<br> <a href="http://www.netscapel.com/download/nav_download.html?">Netscape Navigator 4.04</a>is recommended.</noscript> <!--以下是查询表单的界面--> <form name="form"> <p><br> 关键字: <input type="text" size=25 name="search"> <input type="button" name="submit" value="开始查找" onClick="validate_form()" class="pt9"> <input type="reset" name="reset" value="清除" class="pt9"> <!--如果不需要检索秘决,请取消如下<scrip>和</script>之间的代码--> <!-- document.writeln(\'<font size=2><a href="javascript:doInstructions();" onMouseOver=\'window.status=\\Click here for instructions\\\'; return ture"onMouseOut="window.status=\\\'\\\';return true">查询秘决</a></font>\'); //--> </script> <br> </p> <p> <input type="button" name="view" value="看详细注释的源码" onClick="window.location=&quot;view-source:&quot;+window.location.href" class="pt9"> <br> </p> </form> <!--以下是填入的关键字合法性检查,不要改变。--> <script> <!-- function validate_form(){ txt=document.form.search.value; if(txt.indexOf(",")!=-1){ alert("Search is invalid!Contains a \',\'");return;} if(txt.indexOf("@")!=-1){ alert("Search is invalid!Contains a \'@\'");return;} if(txt.indexOf("#")!=-1){ alert("Search is invalid!Contains a \'#\'");return;} if(txt.indexOf("$")!=-1){ alert("Search is invalid!Contains a \'$\'");return;} if(txt.indexOf("%")!=-1){ alert("Search is invalid!Contains a \'%\'");return;} if(txt.indexOf("*")!=-1){ alert("Search is invalid!Contains a \'*\'");return;} if(txt.indexOf("(")!=-1){ alert("Search is invalid!Contains a \'(\'");return;} if(txt.indexOf(")")!=-1){ alert("Search is invalid!Contains a \')\'");return;} if(txt.indexOf("[")!=-1){ alert("Search is invalid!Contains a \']\'");return;} if(txt.indexOf("]")!=-1){ alert("Search is invalid!Contains a \']\'");return;} if(txt.indexOf(";")!=-1){ alert("Search is invalid!Contains a \';\'");return;} if(txt.indexOf("<")!=-1){ alert("Search is invalid!Contains a \'<\'");return;} if(txt.indexOf(">")!=-1){ alert("Search is invalid!Contains a \'>\'");return;} if(txt.indexOf("?")!=-1){ alert("Search is invalid!Contains a \'?\'");return;} if(txt.indexOf("=")!=-1){ alert("Search is invalid!Contains a \'=\'");return;} else { jsi=new makeLinks(linksize); searchLinks(jsi,txt); document.write("<hr>"); document.write("a href=\'search.htm\'返回检索页</a><br><br>"); //改变上述文件名,指向你的搜索页面,以便访问者返回。 } } //--》 </script> <center> </body> </html>


--  作者:我最简单
--  发布时间:2004/7/26 17:31:00
--  

是什么具体的错误

你调试是什么状况

我机子上IIS都卸了


--  作者:秋思草堂
--  发布时间:2004/7/26 18:50:00
--  

这是用JavaScript写成的。本来应该是不会显示出网页中的一些代码的,却显示出了一部分代码。我不知道那里出了问题啊。可能是少写了点什么吧。。

对了,数据库部分我只写了一条。。测试用的。


--  作者:秋思草堂
--  发布时间:2004/7/29 14:33:00
--  
没人顶啊??