Implement search functionality in home page

Source: Internet
Author: User
Tags implement query string window
The internet is indeed magnificent, profound, and it is because of its magnificent and profound and many of the first network of internet worms are rushing to the information to beat the dizzy, finally empty-handed, nothing. Experienced users are not satisfied with the information on a Web site, but also refer to other similar sites on the comparison of information to ensure that the information available to the most comprehensive and accurate, this will be able to find all the information you need to the Web site. Users who have used any of the search engines know that these problems are very simple here. Instead of teaching you how to use search engines, this article tells you how to call these search engines on your own home page.
The key problem in calling a search engine in a home page is to master the use formats of these search engines and the window operations in the home page. The first question is actually very simple, enters each search engine carries on the search, notes the location column the use format can; The purpose of window operation in the homepage is to ensure the integrity and overall perception of the original Web page. The following program lists the online commonly used "YAHOO" and other six major search engines, readers can follow this article to provide the method to increase or decrease the search engine to the program. By pressing the Start Search button, the program calls the selected search engine in turn and searches for the string entered. Open each window to see how the results of the six search engines are different. Such a powerful search, I am afraid there will be no more "slip through the window."
< HTML >
< head >
< title >
Implement search functionality in home page
</title >
< scriptlanguage= "JavaScript" >
<! --
Functionsearch ()//processing the input string, substituting the plus sign for null
Pane
{varzfc=document.eingabe.searchtext.value;
Varsearchword= "";
for (vari=0;i< zfc.length;i++)
{varjiequ=zfc.substring (i,i+1);
if (jiequ== "") searchword+= "+"
elsesearchword+=jiequ;}
If Yahoo is selected, open a new window and call Yahoo to
Search, hereinafter
if (document.eingabe.yahoo.checked)
{varyahoo= Open ("http://search. Yahoo. Com
/bin/search?p= "+searchword," Yahoo "," Toolbar=yes
, Location=yes,directories=yes,status=yes,menubar=yes,
Scrollbars=yes,resizable=yes ");}
Lycos
if (document.eingabe.lycos.checked)
{Varlycos=open ("Http://lycos.cs.") Cmu. edu/cgi
-Bin/pursuit? query= "+ searchword+" &map ab= the
-Catalog "," Lycos "," toolbar= Yes, location= Yes
, Directories=yes,status=yes,menubar=yes, scrollbars
=yes,resizable=yes ");}
Excite
if (document.eingabe.excite.checked)
{Varexcite=open ("Http://www.excite.com/search
. Gw? Search= "+ searchword+" &map Collection
= web&mapsearchtype= concept&mapmode= Relevance&map

Showqbe= 1 &mapdisplay= html2% 2Clb ", excite"
, "toolbar=yes,location=yes,directories= Yes, status
=yes,menubar=yes,scrollbars=yes,resizable=yes ");}
InfoSeek
if (document.eingabe.Infoseek.checked)
{varinfoseek= Open ("http: www.") InfoSeek
. com/titles?qt= "+searchword+" &mapcol= ww&mapsv= is
&map lk=noframes&mapnh=10 "," InfoSeek "," Toolbar=yes
, Location=yes,directories=yes,status=yes,menubar=yes,
Scrollbars=yes,resizable=yes ");}
WebCrawler
if (document.eingabe.WebCrawler.checked)
{Varwebcrawler=open ("http://webcrawler.com/cgi
-Bin/webquery? searchtext= "+ searchword+" "
, "WebCrawler", "toolbar=yes,location=yes,directories
= yes, status= Yes, menubar= Yes, scrollbars= Yes
, Resizable=yes ");}
HotBot
if (document.eingabe.Hotbot.checked)
{Varhotbot=open ("Http://www.hotbot.") com/? Mt= "
+searchword+ "&mapsw=web&mapsm=mc&maprg=na&map-v=2
&mapact.search.x=81&mapact.search.y= "," HotBot "
, "toolbar=yes,location=yes,directories= Yes, status
=yes,menubar=yes,scrollbars=yes,resizable=yes ");}}
-->
</script >< bodybgcolor= "#ffffff" text= "#000000" link= "#
b50000 "alink=" #0000b5 "vlink=" #0000b5 ">
< p >< fontcolor= "red" >< h3 >
This program is a personal homepage in the search engine to implement a string search example, the program only listed the most commonly used six of search engines, readers can add or subtract. Because the program uses the window technology, therefore does not affect the original homepage The integrity and the appearance.
</H3 ></font ></P >< Center >
< Formname= "Eingabe" onsubmit= "Search" ()
; returnfalse; ">
Please enter a string to search for:
< Inputtype=textname= "SearchText" Size=30value
= "" >
< p >
< inputtype= Checkboxname
= "Yahoo" CHECKED &gtYahoo< br >
< inputtype= Checkboxname
= "Lycos" CHECKED &gtLycos< br >
< Inputtype=checkboxname= "Excite" CHECKED
&gtExcite< br >
< Inputtype=checkboxname= "InfoSeek" CHECKED
&gtInfoseek< br >
< Inputtype=checkboxname= "WebCrawler" CHECKED
&gtWebCrawler< br >
< Inputtype=checkboxname= "HotBot" CHECKED
&gtHotbot< br >
< p >
< inputtype=buttonvalue= "Start searching for" onclick= "
Search () ">
</form >
</body >



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.