Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating search tool for website

Status
Not open for further replies.

shruti18

MIS
Jun 22, 2005
30
US
Hi,
I am looking to create a search tool for a website. Would it be possible using Java Scripts?
 
No, this isn't possible unless you're using Javascript as your language for ASP. Javascript otherwise works only on the client-side computer, while the files you want to search are on the server.

Lee
 
easiest way is to use google to search just your site. Here's an example used on the site

Code:
<form style="margin-top:4px;margin-bottom:4px" method="get" name="searchform" action="[URL unfurl="true"]http://www.google.com/search"[/URL] target="_blank">
<input type="hidden" name="as_sitesearch" value="[URL unfurl="true"]www.w3schools.com"[/URL] />
<input type="text" style="width:90px" name="as_q" size="20" />&nbsp;<input style="width:20px;font-weight:bold" type="submit" value="..."/>
</form>

Change it as necessary.
Obviously it will only be as good as the results google has for your site.
 
Hi Chris,
Thanks for your response.
I am trying to use JSE internal search engine as recommended by you, but there is an error which I am getting, in jse_search.js, saying document undefined.
Could you point out what is the reason for this?
 
shruti18

It sounds as though the document name referenced in the second column of the array 's' in jse_search.js, which holds the data, is incorrect.

To keep it simple initially, suggest you place jse_search.js and all html files in the 'root' folder of your website.

A row in the array 's' should then look like
Code:
s[0]="How to search for a word^myfile.html#25^To search for a word on this site...^keyword,keyword,keyword";

FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommandertm.net
PDFcommandertm.com
 
shurti18,

I'm assuming the link you're trying to access is:
If so, then the array should be set as:
Code:
var item = new Array();
Km=0; item[Km]=new Array("[COLOR=red]pitt.edu/~play/auditions.htm[/color]","[COLOR=blue][URL unfurl="true"]http://www.[/URL][/color]","[COLOR=teal]Auditions[/color]","[COLOR=green]audition, auditions[/color]","[COLOR=maroon]Auditions for University of Pittsburgh[/color]");

This is what the array setup is like:

The entire link goes here (EX: mysite.com/page1.cfm)

The prefix of the site goes here {EX:
The name of the link to be displayed on the search window goes here. users click this to get their destination

Search/keywords goes here (comma seperated list: any,all,auditions,pittsburgh,uop)

you forgot this array element. This section shows a text description of what the link is for, kind of like a summary of what the link is meant for

See here for an example:

____________________________________
Just Imagine.
 
hi ketan,
thanks for ur reply
i actually have used the JSE internal search engine for right now and i made that to work.
thanks for all ur help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top