Here are instructions to apply this JavaScript
for your own Web site. Please read this first
before you go ahead to build your own SiteSearch page.
But, it's simple --so I think, if you have some
knowledge in writing HTML documents.
This SiteSearch is to include as JavaScript on your SiteSearch page
(as JavaScript source in the <HEAD></HEAD> section) and
the search field entry as <FORM></FORM> in the
<BODY></BODY> section of the HTML document:
<HTML>
<HEAD>
.... that
script
.... which is explained within the source on
.... comments,
.... lines or parts with
.... prefix using : are
to modify for your use
.... (at your own risk),
.... the complete
source is to save as search.html
</HEAD>
<TITLE>my SiteSearch</TITLE>
<BODY>
<CENTER>
Search my pages:<BR>
<FORM NAME='searchForm'
onsubmit='return checkField(document.searchForm)'>
<FONT FACE='Arial' SIZE=-1>Please enter term(s) below
and press
<i><b>find</b></i>
button:</FONT><BR>
<INPUT TYPE='text' SIZE=28 NAME='search_name'><BR>
<INPUT TYPE='button' VALUE='Find'
onClick='return checkField(document.searchForm)'>
<INPUT TYPE='reset' VALUE='Clear'><BR>
<FONT FACE='Arial' SIZE=-1>Fast SiteSearch JavaScript
Engine!</FONT><BR>
</CENTER>
</BODY>
</HTML>
this HTML code looks on the search page:
Search my pages:
when you click this Find button there, you'll see that no indexed
pages were found.
Now, let's create your own index for the Fast SiteSearch JavaScript:
create by an ASCII-Editor your own index to every Web page with the following
pattern line by line:
I("URL","Title,one Keyword,keyword
two,other
keywords");
at least, there must be a valid
URL
and a
Title
of an indexed Web document. The URL could refer to any page on your site
or to any on the Web, i.e. to HTML document mysite.html, to image
pic.jpg or sound-file happybirthday.wav or video-file
holidays.avi on your site, or to any on the Web. All the keywords
and the title, and the URL of your indexed Web document must be enclosed
by single or double quotes (not mixed) and separated by commas like the pattern
above.
one index in example:
I("sas_tips.html","tips,techniques,programming,topics");
I("datasets.html","Datasets,JASA,archive,IASC,SAS");
I("sas_conferences.html","SAS Conferences,SUGI,SEUGI");
I("deja-sas.html","Search SAS-L,newsgroups");
I("http://lib.stat.cmu.edu","StatLib,Carnegie Mellon
University,CMU");
I("medline.html","Search,bioethicsline,healthstar");
I("sas-links.html","Links to SAS System");
I("stat-links.html","Statisticians");
I("what_sas.html","The SAS System,License,licence");
I("a.sas","Calculates Main Point,limited
areas,Schwerpunkt");
... and so on line by line ...
If there are all Web pages indexed replace now the present index from the
file my_index.js with your
own and save it as my_index.js.
If you are using FRAMES on your Site and the page with the displayed results
differs from the search page with the search field entry, specify the frame
name in the JavaScript source in file: search.html as noted
there (see variable: FrameName). The frame name is case sensitive. If you
don't use frames, you could ignore this step.
You have now 2 files:
-
search.html and
-
my_index.js
for your search page.
Save both and check it local by loading search.html into the Web browser
and -if it's o.k., transfer both files to your Web directory at the Web server
from your ISP (your Web provider) check it there again and you are
finished.
The indexes of additional Web pages could be added within the index file
my_index.js at any time. Provide than the updated index file
my_index.js on your Web site; no more changes are necessary to use
the updated indexes on search.
Note, the filename of my_index.js must correspond with filename at
the statement <SCRIPT ...
SRC="fileame"></SCRIPT> at the top of
search.html.
|