Getting WebSearchers On Your Site | ||
| ||
| call a variety of search engines like Yahoo or Google by simply typing a phrase in the search box and selecting the search engine. So in your HTML file, create any number of links and use the 'searchem' function to call a engine when a hyperlink corresponding to an engine is clicked. This calls the engine with the site and the text which is stored in the textbox named box (hence the line text=box.value). You Enjoy! <script language="JavaScript1.2"> function searchem(engine) { var link,text; text=box.value; if (engine==0) link="http://www.google.com/search?q="+text; if (engine==1) link="http://www.yahoo.com/bin/search?p="+text; if (engine==2) link="http://www.lycos.com/cgi-bin/pursuit?cat=lycos&query="+text; if (engine==3) link="http://infoseek.go.com/Titles?col=WW&qt="+text; if (engine==4) link="http://infoseek.go.com/Titles?col=WW&qt="+text; window.location.replace(link); } </script> | ||
| | ||
| |