中国网站美工网!网页设计者的天堂!
本站特色:HTML网页模版下载    
  您的位置:

首页 >> 网页特效 >> 测试搜索 >> 正文

相关信息

在跳出的对话框中输入关键字然后
较为简单的搜索器
这个脚本将查询的结果显示在了文
再一个不错的搜索脚本
若干道试题,自动给出成绩,并MA
同样是搜索脚本,好像这个界面好
又一不错的搜索引擎...
健康值测试
超级酷搜索引擎
测试网站进入速度很实用
测试网页的链接速度
一个很普通的综合搜索引擎,你也可
这个用来做调查很好
加减乘除的运算测试
在选题的同时跳出对话框提示
一个选题,完成后给出结论
问卷调查脚本
这是EQ测试题 (也可以用来测试做
搜索引擎登记脚本
在你的网页上加上多个搜索引擎的

不错的页面搜索脚本

不错的页面搜索脚本


来源: 不详 | 时间: 2006-1-15 18:44:40 | 人气:

 

不错的页面搜索脚本

要完成此效果需要两个步骤

第一步:把如下代码加入到<body>区域中

<div align="center">
  <script language="JavaScript">

<!--

// 下面是负责搜索的页面的全路径或相对路径

var search_htm_url = "test.htm";

 

function searchPage() {

if ((document.searchpage.keyword.value.length == 0)

|| (document.searchpage.keyword.value == " ")) {

alert("请填入关键字!");

} else {

sel = document.searchpage.and_or.selectedIndex;

location.href = search_htm_url + "?"

+ escape(document.searchpage.keyword.value)

+ (sel==0?"&and":(sel==2?"&exact":"&or"));

}

return false;

}

 

document.write('<form name="searchpage" onSubmit="return searchPage()">'

+'请填入关键字(试试填入java): <input type="text" size=22 name="keyword"> '

+'<input type="button" value="Search" onClick="searchPage()"><br>'

+'<select name="and_or" size=1><option>关键字与搜索<option>关键字或搜索 '

+'<option>关键字异或搜索</select></form>');

// -->

</script>
</div>


第二步:同一目录新建“test.htm”内容如下

<form NAME="database">
<input type="hidden" name="list"
value="http://typhoon.500.to~Typhoon Start|javascript乐园  ^JavaScript Fairyland
">
</form>
<!--以上可以自行调整-->
<script language="JavaScript">
<!--
function Page(url,title,keywords,description) {
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;
this.description = description;
return this;
}
function Database() {
var pos = 0;
while ((pos1 = amorphous.indexOf("~",pos)) != -1) {
pos2 = amorphous.indexOf("|",pos1+1);
pos3 = amorphous.indexOf("^",pos2+1);
pos4 = amorphous.indexOf("*",pos3+1);
if ((pos2 != -1)
&& (pos2 < pos3) && (pos3 < pos4)
&& (pos4 <= amorphous.indexOf("*",pos))) {
this[database_length++] = new Page(amorphous.substring(pos,pos1),
amorphous.substring(pos1+1,pos2),
amorphous.substring(pos2+1,pos3),
amorphous.substring(pos3+1,pos4));
pos = pos4+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;
}
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();
len = (and_search=="and"&&q>0?menu_length:database_length);
for (n=0; n<len; n++) {
if (and_search=="and"&&q>0) {

本新闻共3页,当前在第1页  1  2  3  

 
  上一篇:在跳出的对话框中输入关键字然后查找的脚本  下一篇:没有了
Copyright © 2005 - 2006 WEB600.Net,All Rights Reserved
业务联系 QQ 站长:106324307 美工:270348300 程序:63888546
E-mail: 3235183@163.com MSN: fuqiyangru@hotmail.com
中国网站美工网--网页设计者的天堂! 陕ICP备06005517号
本站资源来自互联网 如果侵犯您的权利 请通知我们 我们会尽快删除