📄 search5.htm
字号:
<html>
<head>
<title>站内搜索脚本(五)</title>
<style type="text/css">
<!--
body { font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px}
A { COLOR: black; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none }
A:hover { COLOR: red; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: underline }
a:active { font: 9pt "宋体"; cursor: hand; color: #FF0033 }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#fef4d9">
<br>
<br>
<center><font color=red face="隶书" size=6>站内搜索脚本(五)</font></center>
<br>
<br><center>
<table border=5 bordercolor=blue borderlight=green>
<tr><td align=center><font size=5 color=red face="Arial, Helvetica, sans-serif"><strong>下面框中为脚本显示区</strong></font></td></tr>
<tr><td align=center width=300><SCRIPT LANGUAGE="JavaScript">
<!-- Hide Script from Old Browsers
Keyword = new Object();
Descrip = new Object();
Address = new Object();
// Keyword[0] = n (where n is the number of keywords which can be searched
Keyword[0] = 5 //对应查询组的数量;
Keyword[1] = "javascript"
Descrip[1] = "最全的javascript资源站-javascript2000.com"
Address[1] = "http://www.javascript2000.com"
Keyword[2] = "javascript"
Descrip[2] = "很好的javascript站点"
Address[2] = "http://www.cnlot.com/"
Keyword[3] = "javascript"
Descrip[3] = "java神捕"
Address[3] = "http://pcafei.3322.net/"
Keyword[4] = "javascript"
Descrip[4] = "精彩天地"
Address[4] = "http://demoy.3322.net/"
Keyword[5] = "javascript"
Descrip[5] = "国外最大的javascript资源站"
Address[5] = "http://www.javascript.com/"
function checkDatabase() {
var Found = false
var Item = document.forms[0].searchfor.value.toLowerCase();
stats='toolbar=no,location=no,directories=no,status=no,menubar=no,'
stats += 'scrollbars=yes,resizable=yes'
MsgBox = window.open ("","msgWindow",stats)
MsgBox.document.write("<head><title>查询结果</title></head>");
MsgBox.document.write ("<BODY BGCOLOR=#ffffff TEXT=#000000 LINK=#000080 VLINK=#800040 ALINK=#FF0000><CENTER>查询结果</CENTER>")
MsgBox.document.write ("关键字为: "+Item+"<HR>");
for (var i=1; i <= Keyword[0]; i++) {
if(Item == Keyword[i]) {
Found = true;
MsgBox.document.write (Descrip[i]+"<BR><A HREF="+Address[i]+">点击这里进入</A><br>")
}
}
if(!Found)
MsgBox.document.write ("没有发现与该关键词有关的条目。")
// Leave the line below intact if you want to legally use this script
MsgBox.document.write ("<H4>欢迎您!<BR><A HREF=http://www.njcatv.net>南京有线宽带网</A></H4>")
MsgBox.document.write ("<FORM class='pt9'><CENTER>")
MsgBox.document.write ("<INPUT type='button' value='关闭查询窗口' onClick = 'self.close()'>")
MsgBox.document.write ("</CENTER></FORM>") }
// -->
</SCRIPT>
</p>
<table width="100%" border="0" align="right">
<tr>
<td height="126">
<form name="form1">
<u>请输入查询关键词:</u><br>
<input type="text" name="searchfor" value="" size=20>
<input type="button" value="查询" onClick="checkDatabase()" name="button">
<p>
<p>输入查询关键字"<b><font face="Arial, Helvetica, sans-serif" size="3" color="#FF0000">javascript</font></b>"看看查询结果。
</form>
</td>
</tr>
</table>
</td></tr></table></center>
<br>
<br>
<center>
<textarea name=source rows=12 cols=45 class=yk9>
脚本说明:
第一步:把如下代码加入<body>区域中
<SCRIPT LANGUAGE="JavaScript">
<!-- Hide Script from Old Browsers
Keyword = new Object();
Descrip = new Object();
Address = new Object();
// Keyword[0] = n (where n is the number of keywords which can be searched
Keyword[0] = 5 //对应查询组的数量;
Keyword[1] = "javascript"
Descrip[1] = "最全的javascript资源站-javascript2000.com"
Address[1] = "http://www.javascript2000.com"
Keyword[2] = "javascript"
Descrip[2] = "很好的javascript站点"
Address[2] = "http://www.cnlot.com/"
Keyword[3] = "javascript"
Descrip[3] = "java神捕"
Address[3] = "http://pcafei.3322.net/"
Keyword[4] = "javascript"
Descrip[4] = "精彩天地"
Address[4] = "http://demoy.3322.net/"
Keyword[5] = "javascript"
Descrip[5] = "国外最大的javascript资源站"
Address[5] = "http://www.javascript.com/"
function checkDatabase() {
var Found = false
var Item = document.forms[0].searchfor.value.toLowerCase();
stats='toolbar=no,location=no,directories=no,status=no,menubar=no,'
stats += 'scrollbars=yes,resizable=yes'
MsgBox = window.open ("","msgWindow",stats)
MsgBox.document.write("<head><title>查询结果</title></head>");
MsgBox.document.write ("<BODY BGCOLOR=#ffffff TEXT=#000000 LINK=#000080 VLINK=#800040 ALINK=#FF0000><CENTER>查询结果</CENTER>")
MsgBox.document.write ("For the keyword: "+Item+"<HR>");
for (var i=1; i <= Keyword[0]; i++) {
if(Item == Keyword[i]) {
Found = true;
MsgBox.document.write (Descrip[i]+"<BR><A HREF="+Address[i]+">Click Here To View</A><br>")
}
}
if(!Found)
MsgBox.document.write ("没有发现与该关键词有关的条目。")
MsgBox.document.write ("<H6>Enjoy it!<BR><A HREF=http://java2000.126.com>http://java2000.126.com</A></H6>")
MsgBox.document.write ("<FORM class='pt9'><CENTER>")
MsgBox.document.write ("<INPUT type='button' value='关闭查询窗口' onClick = 'self.close()'>")
MsgBox.document.write ("</CENTER></FORM>") }
// -->
</SCRIPT>
如下代码生成查询表单界面:
<form name="form1">
<u>请输入查询关键词:</u><br>
<input type="text" name="searchfor" value="" size=20>
<input type="button" value="查询" onClick="checkDatabase()" name="button">
<br>
<!-- End Of File -->
<font color="#FF0000">输入小写字符</font>
<p>
</form>
</textarea>
<SCRIPT LANGUAGE="JavaScript">
<!-- hide
function goHist(a)
{
history.go(a);
}
//-->
</script>
<FORM METHOD="post">
<INPUT TYPE="button" VALUE="返回" onClick="goHist(-1)" style="background-color: #8000FF; color: rgb(255,255,255)">
</form>
</center>
<br>
<br>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -