Solved

Searchable web page

Posted on 1997-09-15
5
191 Views
Last Modified: 2013-12-25
I would like to know the specifics involved with setting up a searchable web page.  I have a large list of items and I would ultimately like to provide a text field on one of my pages where viewers can submit a query and search this list of items by product name, description, catalog number, etc.  How is this accomplished?.
0
Comment
Question by:dpate
  • 3
  • 2
5 Comments
 

Author Comment

by:dpate
ID: 1855011
Edited text of question
0
 
LVL 4

Accepted Solution

by:
jshamlin earned 100 total points
ID: 1855012
What you're trying to write is a pretty simple text-matching program - the function is pretty simple to write using indexOf() to find out if text in the page matches text the user entered to search.

Problem is, the text in the page isn't available to Javascript - to do this, you'll have to put all your text into JavaScript arrays, then document.write() that text into the page.   For each item, document.write('<LI>' + itemname[0] + itemdescription[0]); etc.

Problem with *that* is javascript-disabled users won't be able to see your text.  You may have to create separate pages.  Alternately, you could have redundancy by putting anchors in the page and associating each anchor with keywords that are redundantly available in javascript arrays ...

... but before I lead you too far in the wrong direction, let me suggest using something other than javascript to do this.  Javascript is good for simple operations using a relatively small amount of data, but if you want to use it to search a lengthy list, it's gonna be *slow* (and may crash a few users).  

It would be a *much* better idea to use something a bit more robust - a Perl script or a database, either of which is designed to do the kind of text-matching operations you need quickly, efficiently, and dependably.
0
 

Author Comment

by:dpate
ID: 1855013
jshamlin:

Thanks for the comments.  Your last suggestion is, for the most part, what I had in mind.  the information would be in the form of a database (most likely MS-Access).  How could I tie the data in such a format into something which is accessible to a viewer of my web site?

dpate
0
 
LVL 4

Expert Comment

by:jshamlin
ID: 1855014
Integrating a simple database into a Web site is fairly sophisticated.   Maybe that's an understatement - it's "fairly sophisticated" when everything clicks into place and it runs the first try without any troubleshooting.

If you're using Access and you're hosting on an Internet Information Server, it's a little easier, but still no cake walk - you're going to need to write SQL queries into active server pages or "IDC/HTX" connectors and templates.  (Some folks will try to sell you on a Perl kludge - which will work, but it's cantankerous and not very scalable.)

Anyway, the long answer is a few textbooks on SQL and Web database connectivity, and the short answer is "hire a pro."  A WWW-savvy DBA may charge you a few thousand to hook up a relatively simple database, but if you're talking about a commercial site (you mention "products"), then it'll probably be worth it - if your database isn't fast and reliable, potential customers will look elsewhere.

If you need to go it alone, it'll be tough - there are a few tools out there designed to provide "wizards" or simple, GUI-driven processes for setting up Web databases (Symantec Visual Cafe and Front Page 97 come to mind).  I can't give you any testimonials, though: I've always outsourced database development to a professional DBA.


0
 

Author Comment

by:dpate
ID: 1855015
Thanks again for info.  I think I'll take your advice and farm this one out while I still have some hair left.

dpate
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
The viewer will learn how to count occurrences of each item in an array.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now