Make it Searchable - Go It Alone
(Page 3 of 4 )
There is more than one way to make it searchable and make your site easier for traffic to navigate. You may find the answer through Web hosting services offering easy-to-use online tools. You could turn to friendly Web sites with free scripts you can conveniently place right in your online HTML editor. But if none of this sounds at all appealing to you, there’s another option you can take advantage of, though it may be the most difficult choice of the three: simply write the code yourself.
It helps if you take classes and read books to learn HTML, JavaScript and Perl before you create a site, but it’s not necessary for you to do so to offer up well-designed pages or even something so simple as a search bar. You don’t have to be a professional page designer to include search bars to pages. But when it comes to writing the actual code, you’ll find that search bars aren’t so simple after all. Once you learn how to create a search bar for your site, you’ll always be able to change any page to include this feature.
First things first. You have to create a special page in order to implement your search. Begin a new HTML document and name it sitesearch.html. In the body portion of this page, you’ll write the code which will enable search on the site. Play with the size and placement of your search bar as much as you like, but some parts of the code must remain the same for search to work.
The code for a search bar looks like something like this:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin var test="a";
var find='index.html~ page name | keywords *'
+'page2.html~ page 2 name | keywords *'
// End -->
</SCRIPT>
<FRAMESET ROWS="*,150">
<FRAME SRC="sitesearch-main.html" SCROLLING="yes" NAME="main">
<FRAME SRC="sitesearch-display.html" SCROLLING="no" NAME="results">
</FRAMESET>
Note the various characters used in the script; these are not mistakes, but part of the code. Where it says page name and page name 2, you’ll put in the actual names of the pages you want to include in your site‘s search. You’ll also want to type in the keywords for your site. Make sure to separate the keywords you enter with a space for each word. Keep repeating the same code for all the pages you want to include in your site’s search. If you have many pages to include in the search, writing the code itself could take a great deal of time and consideration.
Next: Is It Worth It? >>
More Search Engine Tricks Articles
More By KC Morgan