📄 d0001.htm
字号:
<!--Saved from《天索星网》http://www.tasoo.2000c.net,E-mail:tasoo_cn@yahoo.com.cn-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!-- A:link {text-decoration: none; color:#000000}
A:visited {text-decoration: none; color: #000000}
A:active {text-decoration: none; color: #FF0000}
A:hover {text-decoration: underline; color: FF0000}
body{font-size=9pt}
TH{FONT-SIZE: 9pt}
TD{ FONT-SIZE: 9pt}-->
</style>
<title>《网络教程》之Javascript--站内导航——01</title>
</head>
<body topmargin="0" leftmargin="0">
<div align="center"><center>
<table border="0" width="90%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" colspan="3"><div align="center"><center><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="250"><img src="../photo/jx.gif" border="0" WIDTH="200" HEIGHT="80"></td>
<td width="468" height="60"></td>
</tr>
</table>
</center></div></td>
</tr>
<tr>
<td width="20%" bgcolor="#C8C882" valign="middle" align="center" height="22"></td>
<td width="80%" bgcolor="#C8C882" valign="middle" align="center" colspan="2" height="22"><strong><span style="font-size: 10pt; font-family: Arial">javascript导航类</span></strong></td>
</tr>
<tr>
<td width="20%" valign="top" align="left"><div align="center"><center><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">时间类</a></span></td>
</tr>
<tr>
<td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">文字类</a></span></td>
</tr>
<tr>
<td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">导航类</a></span></td>
</tr>
<tr>
<td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">鼠标类</a></span></td>
</tr>
<tr>
<td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">按钮类</a></span></td>
</tr>
<tr>
<td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">跑马灯</a></span></td>
</tr>
<tr>
<td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm"><strong><font face="Arial">COOKIE</font></strong>类</a></span></td>
</tr>
<tr>
<td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">其他类</a></span></td>
</tr>
<tr>
<td width="100%" valign="middle" align="center" height="10" bgcolor="#505028"></td>
</tr>
</table>
</center></div></td>
<td width="80%" valign="top" align="left" colspan="2"><div align="center"><center><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" bgcolor="#EBEBEB" valign="middle" align="center" height="18" colspan="3"><span style="font-size: 9pt">站内导航——01</span></td>
</tr>
<tr>
<td width="100%" valign="middle" align="center" height="2" colspan="3"></td>
</tr>
<tr>
<td width="100%" valign="middle" align="center" height="1" colspan="3" bgcolor="#000080"></td>
</tr>
<tr>
<td width="16%" valign="middle" align="center" height="22"></td>
<td width="67%" valign="middle" align="center" height="22"><p align="center">测试:试一试查询英文字符“<strong><font face="Arial, Helvetica, sans-serif" color="#FF0000"><span style="font-size: 12pt">tasoo</span></font></strong>”或
中文字符“<font color="#FF0000"><strong><span style="font-size: 12pt">天索</span></strong></font>”,测试输出效果。</p>
<form name="database">
<input type="hidden" name="list" value="http://www.tasoo.2000c.net~tasoo starnet|keywords for first file go here separated by spaces^A great search engine from the makers of AOL!*http://tasoo.yeah.net~天索星网|java javascript search html download cgi perl dhtml games activex 下载 脚本^coolest java and javascript collections for internet surfers to enhance web page!*">
</form>
<p><script language="JavaScript">
<!--
version = 1.0;
// -->
</script> <script language="JavaScript1.1">
<!--
version = 1.1;
// -->
</script> <script language="JavaScript">
<!--
// When set to true, searching for "fun*y" matches in the string "fun sky".
// (it will also match the string "fun and here is some long dummy text for you"
// which is obviously not what they were looking for, so we suggest you set
// match_across_word_boundaries to false)
// When set to false, the * operator will not match across word boundaries so
// the above example will not match.
match_across_word_boundaries = false; // false is suggested strongly
// ************ NO NEED TO MODIFY ANYTHING BELOW THIS POINT ************
function Page(url,title,keywords) {
while ((url.length > 0) && (url.charAt(0) == " ")) {
url = url.substring(1,url.length);
}
this.url = url;
while ((title.length > 0) && (title.charAt(0) == " ")) {
title = title.substring(1,title.length);
}
this.title = title;
this.keywords = keywords;
return this;
}
function Database() {
var pos = 0;
while ((pos1 = amorphous.indexOf("~",pos)) != -1) {
pos2 = amorphous.indexOf("|",pos1+1);
pos3 = amorphous.indexOf("*",pos2+1);
if ((pos2 != -1)
&& (pos2 < pos3) && (pos3 <= amorphous.indexOf("*",pos))) {
this[database_length++] = new Page(amorphous.substring(pos,pos1),
amorphous.substring(pos1+1,pos2),
amorphous.substring(pos2+1,pos3));
pos = pos3+1;
} else { // error reading amorphous database
if (pos+30 <= amorphous.length)
alert('Error reading in amorphous database around "'
+ amorphous.substring(pos,pos+30) + '"');
pos = amorphous.indexOf("*",pos) + 1;
}
}
return this;
}
var array = new Object();
array_length = 0; // Netscape 2 fix
var position = new Object();
position_length = 0; // Netscape 2 fix
function pattern(str) {
array_length = position_length = 0;
while ((str.length > 1) && (str.charAt(0) == "*")) {
str = str.substring(1,str.length);
}
while ((str.length > 1) && (str.charAt(str.length-1) == "*")) {
str = str.substring(0,str.length-1);
}
if (str == "*")
return "(true)";
if (str.indexOf("*") == -1) {
array[array_length++] = str;
pat = "(combo.indexOf(array[0]) != -1)";
} else {
left = right = 0;
pat2 = "";
pat = "(((position[0] = combo.indexOf(array[0])) != -1)";
while ((right = str.indexOf("*",left)) != -1) {
array[array_length++] = str.substring(left,right);
pat += " && (position["+(position_length)+"] < (position["
+(++position_length)+"] = combo.indexOf(array["+(array_length)
+"],position["+(position_length-1)+"]+array["+(array_length-1)+"].length"+")))";
if (!match_across_word_boundaries)
pat2 = " && (no_back_up = ((back_up_pos += combo.substring("
+"temp_pos = back_up_pos = position["
+(position_length-1)+"]+array["+(array_length-1)+"].length,position["
+ (position_length) + "]).lastIndexOf(' ')) < temp_pos))" + pat2;
left = right+1;
}
array[array_length++] = str.substring(left,str.length);
pat += pat2+")";
}
return pat;
}
function search(str) {
menu_length = 0;
temp = new Object();
temp_length = 0;
words_length = 0;
words = new Object();
pos = 0;
while ((pos = str.indexOf(" ")) != -1
&& and_search != "exact") {
words[words_length] = str.substring(0,pos);
if (words[words_length].length > 0)
words_length++;
if (str.length == 1)
str="";
else
str = str.substring(pos+1,str.length);
}
if (str.length > 0)
words[words_length++] = str;
for (q=0;q<words_length;q++) {
temp_length = 0;
str = words[q].toLowerCase();
pattern_string = pattern(str);
start_pos = back_up_pos = 0;
len = (and_search=="and"&&q>0?menu_length:database_length);
for (n=0; n<len; n++) {
no_back_up = true;
position_length = 0;
if (and_search=="and"&&q>0) {
combo = (menu[n].title + " " + menu[n].keywords).toLowerCase();
} else {
combo = (database[n].title + " " + database[n].keywords).toLowerCase();
}
combo = combo.substring(start_pos,combo.length);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -