Search For JavaScript

[Total: 0    Average: 0/5]

Search Engine search menu.

Head Code:

<SCRIPT> 
<!-- Activate Cloaking Device


function addplus(items) 
   {
   var plussed = "";
   for (var t = 1 ; t <= items.length ; t++) 
      {
      if (items.substring(t-1,t) == " ") 
         {  plussed+="+";  }
      else 
         { plussed+=items.substring(t-1,t); }
      }
   return plussed;
   }

//    Do the Search
function doSearch() 
   {
   var words;
   words = document.searchforit.query.value;
   var searchitems;
   searchitems=addplus(words);
   var index;
   //  Obtain the selectedIndex properties from the search engines options for 
   index = document.searchforit.service.selectedIndex;
   if (index>=1)
      {
      var site;
      site = document.searchforit.service.options[index].value;
      site+=searchitems;
      if (notEmpty(searchitems))   
         {
         //window.open("","mainWin");
         //window.open(site,"mainWin");
         window.location=site;
         }
      }
   else
      {alert("nYou must select a search engine.");}
   }

//     Check for empty contents in search searchitems
function notEmpty(word) 
   {
   if (word == "" || word == null) 
      {
      self.status="ENTER SEARCH searchitems";
      alert("nYou must enter a keyword to search for."); 
      document.searchforit.query.focus();  
      return false;
      }
   else 
      {
      self.status = "SEARCHING FOR:  " + word;
      return true;
      }
   }

function howTo()
   {
   alert("nWelcome to my JavaScript Search EnginennSimply choose a search engine from the drop-down menu, enter the keyword to search for, and click on SEARCH.nnSeperate multiple keywords with 'and'.");
   }

function clearIt()
   {
   document.searchforit.query.value="";
   document.searchforit.query.focus();     
   }

// Deactivate Cloaking -->
</SCRIPT>

Body Code:

<CENTER><STRONG><EM>
<FONT COLOR=FFFF00 SIZE=+3>J</FONT><FONT COLOR=FFFF00 SIZE=+2>AVA</FONT>
<FONT COLOR=FFFF00 SIZE=+3>S</FONT><FONT COLOR=FFFF00 SIZE=+2>CRIPT </FONT>
<FONT COLOR=FFFF00 SIZE=+3>S</FONT><FONT COLOR=FFFF00 SIZE=+2>EARCH </FONT>
<FONT COLOR=FFFF00 SIZE=+3>E</FONT><FONT COLOR=FFFF00 SIZE=+2>NGINE</FONT>
</EM></STRONG></CENTER>
<HR WIDTH=300 ALIGN=center SIZE=2>
<BR>

<CENTER>
<FORM NAME="searchforit" ACTION="javascript:doSearch()" method="GET" onSubmit="doSearch()">

<TABLE BORDER=3 WIDTH=450>
<TR>
<TD align="center"><STRONG>Select Site</STRONG>
<TD align="center"><SELECT NAME="service">
<OPTION SELECTED VALUE="">------  WWW  Search  Engines   ------- 
<option value="http://all4one.com/php.cgi/home.html?search_string=">All 4 One Search
<option value="http://altavista.digital.com/cgi-bin/query?pg=q&what=news&fmt=&q=">Alta Vista Usenet 
<option value="http://altavista.digital.com/cgi-bin/query?pg=q&what=web&fmt=&q=">Alta Vista WWW
<option value="http://wombat.doc.ic.ac.uk/?">Dictionary of Computing 
<option value="http://galaxy.einet.net/www/www.html?">EINet Galaxy 
<option value="http://query2.lycos.cs.cmu.edu/cgi-bin/pursuit?">Lycos
<option value="http://www.metacrawler.com/cgi-bin/nph-metaquery.p?general=">MetaCrawler
<option value="http://search.opentext.com/omw/simplesearch?mode=phrase&SearchFor=">Open Text Index
<option value="http://rbse.jsc.nasa.gov/htbin/urlsearch?">RBSE
<option value="http://guaraldi.cs.colostate.edu:2000/cgi-bin/savvy-frontend?KW=">Savvy Search 
<option value="http://webcrawler.com/cgi-bin/WebQuery?">WebCrawler 
<option value="http://search.yahoo.com/bin/search?p=">Yahoo 
</SELECT>
</TR>
<TR><TD><TD></TR>
<TR>
<TD align="center"><STRONG>Search For</STRONG>
<TD align="center"><input name="query" VALUE="javascript and examples" size=35>
</TR>
</TABLE> 
<BR><BR>
<TABLE BORDER=0 WIDTH=375>
<TD align="center"><INPUT TYPE="button" VALUE="SEARCH" onClick="doSearch()">
<TD align="center"><INPUT TYPE="button" VALUE="  Clear  " onClick="clearIt()">
<TD align="center"><INPUT TYPE="reset"   VALUE=" RESET ">
</TABLE>
<BR><BR>
<TD align="center"><INPUT TYPE="button" VALUE="How To Use This Search Engine" onClick="howTo()"> 
</FORM> 
</CENTER> 

Times Viewed: 2

Leave a Reply

Your email address will not be published. Required fields are marked *