要完成此效果把如下代碼加入到區(qū)域中
<script language = "JavaScript">
var key = "";
function makeEntry ()
{
this.Name="";
this.URL = "";
this.Desc = "";
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];
}
return this;
}
var linksize=0;
namesArray = new makeArray(linksize);
urlsArray = new makeArray(linksize);
descArray = new makeArray(linksize);
var arraycount=0;
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/desktop/adc120.html"
namesArray[arraycount] = "Advanced Disk Catalog v1.20 beta 1"
descArray[arraycount] = "Catalog your disks, folders and files"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/tools/azpr.html"
namesArray[arraycount] = "Advanced ZIP Password Recovery v0.91a"
descArray[arraycount] = "Recover lost password for encrypted ZIP file"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/games/AdveWith.html"
namesArray[arraycount] = "Adventures With Chickens 2.01"
descArray[arraycount] = "A Christian Windows-95 Arcade/Adventure Game"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/games/INV58FUL.html"
namesArray[arraycount] = "Alien Invasion 1.0"
descArray[arraycount] = "Action Game for players with disabilities"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/games/ayatze22.html"
namesArray[arraycount] = "All In One Yahtzee v2.2"
descArray[arraycount] = "Advanced yahtzee game with 5 variations."
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/games/atris_10.html"
namesArray[arraycount] = "Alphatris v1.0"
descArray[arraycount] = "Arcade style word game for windows 95"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/inet/amg32setup.html"
namesArray[arraycount] = "Amigo! v2.2 "
descArray[arraycount] = "Internet Enabled, Free Form PIM"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/games/32anbj12.html"
namesArray[arraycount] = "Animated Blackjack v1.2"
descArray[arraycount] = "A realistic game with great graphics.."
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/games/95ani12.html"
namesArray[arraycount] = "Animated Slots v1.2"
descArray[arraycount] = "A fun 5 wheel slot machine with great graphics.."
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/inet/pie184.html"
namesArray[arraycount] = "ApplePie Pro HTML Editor 1.8.4"
descArray[arraycount] = "Tag highlighting, JavaScript, Homepage Wizard"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/tools/apackmk1.html"
namesArray[arraycount] = "arclab Packager MK1 1.2.0.61"
descArray[arraycount] = "Split one or more files into packages"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/games/bbsetup.html"
namesArray[arraycount] = "BrainsBreaker 2.1"
descArray[arraycount] = "Create and play jigsaw puzzles in Windows95"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/business/bs1sb.html"
namesArray[arraycount] = "BS1 Small Business v1.1"
descArray[arraycount] = "Bill customers, pay vendors, and manage accounting"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/games/bubble97.html"
namesArray[arraycount] = "Bubble Puzzle 97 v1.1g"
descArray[arraycount] = "Bubble Puzzle 97 from Conmeg. Bust-a-move clone."
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/business/bfsnf216.html"
namesArray[arraycount] = "Budget for Success Win95 v2.16"
descArray[arraycount] = "Budget databases, mortgages, investment planner."
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/program/bc10.html"
namesArray[arraycount] = "Bug Collector 1.0"
descArray[arraycount] = "Manage feature requests and problem reports easier."
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/games/bzzz_1_01.html"
namesArray[arraycount] = "Bzzz! 1.01"
descArray[arraycount] = "Win95 Game Control a frog to catch flies."
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/inet/cachekil.html"
namesArray[arraycount] = "Cache Killer Pro 1.4"
descArray[arraycount] = "Clean up Internet Cache folders"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/business/cal9107b.html"
namesArray[arraycount] = "Calendar+ v1.07.00"
descArray[arraycount] = "Appointment scheduler and to do minder"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/business/cb32.html"
namesArray[arraycount] = "Calendar Builder v2.2b"
descArray[arraycount] = "Quickly and easily make your own custom calendars."
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/multi/cdm160.html"
namesArray[arraycount] = "CDMaster v1.6"
descArray[arraycount] = "CDPlayer w/Dubbing and Picture Attachment"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/inet/cgixpert.html"
namesArray[arraycount] = "CGI Expert 3.03"
descArray[arraycount] = "CGI/ISAPI/NSAPI component suite for Delphi and C++"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/tools/clox_5.html"
namesArray[arraycount] = "CLOX v1.3"
descArray[arraycount] = "Gives you world times on your desktop"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/desktop/snow_wi.html"
namesArray[arraycount] = "D2G Snow screen saver v1.00"
descArray[arraycount] = "Displays snow falling on a starry night w/snowman."
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/inet/dbQuickPage.html"
namesArray[arraycount] = "dbQuickPage 1.1"
descArray[arraycount] = "Database to HTML conversion for the Web."
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/misc/ftrim21.html"
namesArray[arraycount] = "Final Trim v2.1"
descArray[arraycount] = "A Win95 WWII Submarine Multimedia Publication"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/inet/np25.html"
namesArray[arraycount] = "NetPopup 2.51"
descArray[arraycount] = "Messaging tool for Networks"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/inet/nmong144.html"
namesArray[arraycount] = "NewsMonger Search Agent 1.44"
descArray[arraycount] = "Automatically monitor newsgroups for keywords"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/tools/notebk32.html"
namesArray[arraycount] = "Notebook v5.1"
descArray[arraycount] = "Large file text editor."
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/commun/nprsv15.html"
namesArray[arraycount] = "NotePager 1.5"
descArray[arraycount] = "An easy to use alphanumeric paging software"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/multi/ntrack10.html"
namesArray[arraycount] = "n-Track v1.5.2"
descArray[arraycount] = "An audio/MIDI shareware multitrack recorder"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/business/sd20.html"
namesArray[arraycount] = "SecurDesk! 2.0"
descArray[arraycount] = "Security environment and utilities for Win 95/NT"
arraycount += 1
urlsArray[arraycount] = "http://www.win-shareware.com/desktop/yapla16.html"
namesArray[arraycount] = "Yapla V1.6"
descArray[arraycount] = "YAPLA - Yet Another Program Launcher"
linksize = arraycount;
function searchLinks(links, keyword, hits, dirw)
{
var resultcount=0;
document.write('');
document.write('');
document.write('
');
document.write("Results for keywords: " +keyword +"");
document.write(' |
|
');
document.write('
');
for (var q=1; q<=links.length; q++)
{
if (links[q].URL.toLowerCase().indexOf(dirw) != -1)
{
if (links[q].Desc.toLowerCase().indexOf(keyword) != -1)
{
resultcount += 1;
if (resultcount > hits)
{
break;
}
else
{
document.write("- ");
document.write("" + links[q].Name +
"");
document.write(" -" + links[q].Desc + "
");
continue;
}
}
if (links[q].Name.toLowerCase().indexOf(keyword) != -1)
{
resultcount += 1;
if (resultcount > hits)
{
break;
}
else
{
document.write(" - ");
document.write("" + links[q].Name +
"");
document.write(" -" + links[q].Desc + "
");
continue;
}
}
}
}
}
</script>
<script>
function validate_form()
{
txt = document.form.search.value;
newindex = document.form.numhits.selectedIndex;
dahits = document.form.numhits[newindex].value;
newindexb = document.form.whichdir.selectedIndex;
dadir = document.form.whichdir[newindexb].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;}
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, dahits, dadir);
document.write('
');
document.write('
....... 查詢結(jié)果結(jié)束 .......');
document.write('
');
document.write('');
}
}
</script>