prøv det her.
<html>
<head>
<title>søgning</title>
</head>
<body>
<SCRIPT LANGUAGE=\"JavaScript\">
Keyword = new Object();
Descrip = new Object();
Address = new Object();
Keyword[0] = 6
Keyword[1] = \"javascript\"
Descrip[1] = \"JavaScript World is the best JavaScript site on the Net.\"
Address[1] = \"
http://www.mydesktop.com/javascript/\"Keyword[2] = \"yahoo\"
Descrip[2] = \"Search the BEST engine on the internet.\"
Address[2] = \"
http://www.yahoo.com\"Keyword[3] = \"world\"
Descrip[3] = \"JavaScript World is the best JavaScript site on the Net.\"
Address[3] = \"
http://www.mydesktop.com/javascript/\"Keyword[4] = \"free\"
Descrip[4] = \"Free webpages at Geocities.\"
Address[4] = \"
http://www.geocities.com\"Keyword[5] = \"free\"
Descrip[5] = \"Free webpages at Tripod\"
Address[5] = \"
http://www.tripod.com\"Keyword[6] = \"free\"
Descrip[6] = \"Free JavaScript at JavaScript World\"
Address[6] = \"
http://www.mydesktop.com/javascript/\" 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 (\"<BODY BACKGROUND=back.jpg BGCOLOR=#C0C0C0 TEXT=#000000 LINK=#000080 VLINK=#800040 ALINK=#FF0000><H2><CENTER>Søge resultat</CENTER></H2>\")
MsgBox.document.write (\"<H3>efter søgeordet \"+Item+\"<HR>\");
for (var i=1; i <= Keyword[0]; i++) {
if(Item == Keyword[i]) {
Found = true;
MsgBox.document.write (\"<H4>\"+Descrip[i]+\"<BR><A HREF=\"+Address[i]+\">Klik her for at kigge</A></H4>\")
}
}
if(!Found)
MsgBox.document.write (\"<H4>Fandt intet</H4>\")
MsgBox.document.write (\"<FORM><CENTER>\")
MsgBox.document.write (\"<INPUT type=\'button\' value=\'Luk vindue\' onClick = \'self.close()\'>\")
MsgBox.document.write (\"</CENTER></FORM>\") }
</SCRIPT>
<FORM NAME=\"form1\">
<B><U>skriv dit søgeord</B></U> <FONT SIZE=1>kræver netscape 3.0</FONT><BR>
<INPUT TYPE=\"text\" NAME=\"searchfor\" VALUE=\"\" SIZE=20><br><INPUT TYPE=\"button\" VALUE=\"Search the base.\" onClick=\"checkDatabase()\"><BR>
</body>
</html>
Du skal selvfølgelig kun ændre dine søgeord og URL\'s. Lidt besværligt script hvis der er mange søgeord.