Site Search Script Example five (JavaScript)

Source: Internet
Author: User
Script Description:
The first step: Add the following code to the <body> area
<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 searched
KEYWORD[0] = 5//number of corresponding query groups;
KEYWORD[1] = "JavaScript"
DESCRIP[1] = "Most complete JavaScript resource station-javascript2000.com"
ADDRESS[1] = "http://www.javascript2000.com"
KEYWORD[2] = "JavaScript"
DESCRIP[2] = "Good JavaScript site"
ADDRESS[2] = "http://www.cnlot.com/"
KEYWORD[3] = "JavaScript"
DESCRIP[3] = "Java Divine capture"
ADDRESS[3] = "http://pcafei.3322.net/"
KEYWORD[4] = "JavaScript"
DESCRIP[4] = "Wonderful World"
ADDRESS[4] = "http://demoy.3322.net/"
KEYWORD[5] = "JavaScript"
DESCRIP[5] = "Foreign largest JavaScript resource station"
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 ("MsgBox.document.write ("<body bgcolor= #ffffff text= #000000 link= #000080 vlink= #800040
alink= #FF0000 ><CENTER> Query Results </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 to View</a><br>")

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.