JavaScript DHTML/Ajax Layer/Search Engine

Материал из Web эксперт
Перейти к: навигация, поиск

Do a search on different search engine at the same time

   <source lang="html4strict">

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head>

 <title>Search multiple engines</title>
 <link rel="shortcut icon" href="/images/favicon.ico" />
 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 <meta name="keywords" content="search,google,yahoo,alltheweb,msn,wiki,ivar,abrahamsen">
 <meta name="description" content="search enginer page">
 <style type="text/css">
 /**************************
 Copyright         : electric ray
 Filename         : search.css
 Created          : 2004-05-20  10:03  :  ivar
 Last Updated     : 2004-05-20  10:03 :  ivar
 Version          :  0 . 01
 Comments         :
                                                    • /
  1. wrapper{

}

  1. wrapper > tr > td {
 text-align: center;

}

  1. main{
 border: 3px outset silver;
 background-color: #99ccff;

}

  1. main > tr > td{
 padding: 5px;
 font: bold 10pt "Comic Sans", Sans, Tahoma;
 text-align: center;

}

  1. main td{
 padding: 5px;

}

  1. main .logo{
  width: 20px;

}

  1. main td#title{
 font-size: 18pt;
 text-align: center;
 /*width: 100%;*/

}

  1. main #searches {

}

  1. main #searches td{
 white-space: nowrap;

}

  1. main #searches ul{

}

  1. main #searches li{
 list-style: none;

}

  1. main td#submit{
 text-align: center;

}

  1. main input#submit{
 background-color: #ffcc99;
 width: 400px;
 font: bold 12pt "Comic Sans", Sans, Tahoma;
  border: 2px groove red;

}

   </style>
 <script language="JavaScript" type="text/javascript">

/**************************

 Copyright         : electric ray
 Filename         : search.js
 Created          : 2004-05-20  10:03  :  ivar
 Last Updated     : 2004-05-20  10:03 :  ivar
 Version          :  0 . 01
 Comments         :
                                                    • /

//###### mini functions function changeAction( form, what ){

 form.action = what;

} function goSearch(){

 //return false;
 return true;

} //###### Objects //############################ //# function : SearchEngine //# create date : 2004-05-20 10:03  : ivar //# last mod. : 2004-05-20 10:03 : ivar //############################ function SearchEngine(){

 //## methods
 this.run = engineRun;
 this.close = engineClose;
 this.spliter = engineSplit;
 this.build = engineBuild;
 this.addURL = engineAddURL;
 this.frame = engineFrame;
 this.setTMPL = engineTMPL;
 //## variables
 this.search = "";
 this.params = "";
 this.engines = "";
 this.urls = new Array();
 this.tmpl =
   "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"><html><head></head>"
   +  "::FRAMES::"
   + "</HTML>";

} //###### Methods //############################ //# function : engineRun //# create date : 2004-05-20 10:03  : ivar //# last mod. : 2004-05-20 10:03 : ivar //############################ function engineRun(){

 this.spliter();
 this.build();

} //############################ //# function : engineSplit //# create date : 2004-05-20 10:03  : ivar //# last mod. : 2004-05-20 10:03 : ivar //############################ function engineSplit(){

 this.params = new Array();
 this.engines = new Array();
 this.search = location.search.substring(1);
 this.tprm = this.search.split("&");
 for ( this.i in this.tprm ){
   this.sprm = this.tprm[ this.i ].split("=");
   if( this.sprm[0] == "engine" ){
     this.engines.push(this.sprm[1]);
     if( this.sprm[1] == "wiki" )
       alert("Please noteWikipedia forces itself to be the only frame shown");
   }
   else
     this.params[ this.sprm[0] ] = this.sprm[1];
 }

} //############################ //# function : engineBuild //# create date : 2004-05-20 10:03  : ivar //# last mod. : 2004-05-20 10:03 : ivar //############################ function engineBuild(){

 this.html = this.tmpl;
 this.frames = "<frameset rows="*";
 for(this.j=1;this.j<this.engines.length;this.j++)
   this.frames += ",*";
 this.frames += "" >";
 for( this.i in this.engines ){
   this.frames  += this.frame( this.engines[ this.i ], this.params[ "string"  ] );
 }
 this.frames += "</frameset>";
 this.html = this.html.replace("::FRAMES::", this.frames );
 //alert( "this.html:\n" + this.html );
 frameholder.document.open("text/html");
 frameholder.document.writeln( this.html );
 frameholder.document.close();

} //############################ //# function : engineFrame //# create date : 2004-05-20 10:03  : ivar //# last mod. : 2004-05-20 10:03 : ivar //############################ function engineFrame(engine,query){

 this.url = "http://" + this.urls[engine] + query;
 this.tag = "<frame name="" + engine + "" src=""
   + this.url + "" />\n";
 return this.tag;

} //############################ //# function : engineAddURL //# create date : 2004-05-20 10:03  : ivar //# last mod. : 2004-05-20 10:03 : ivar //############################ function engineAddURL( key, url ){

 this.urls[ key ] = url;

} //############################ //# function : engineTMPL //# create date : 2004-05-20 10:03  : ivar //# last mod. : 2004-05-20 10:03 : ivar //############################ function engineTMPL( tmpl ){

 this.tmpl = tmpl;

} //############################ //# function : engineClose //# create date : 2004-05-20 10:03  : ivar //# last mod. : 2004-05-20 10:03 : ivar //############################ function engineClose(){ } //###### Initzialisers

//############################ //# function : //# create date : 2004-05-20 10:03  : ivar //# last mod. : 2004-05-20 10:03 : ivar //############################

//######

 </script>
 <script language="JavaScript" type="text/javascript">
   function loader(){
   }
   function unloader(){
   }
 </script>

</head> <body onload="loader()" onunload="unloader()">

<form action="search.html" method="get" aonsubmit="return goSearch()" id="mainform"> </form>
Multiple Search Engine <a href="http://www.electricray.org" target="_top"><img border =0 height=20 src="/images/eraylogorayonlytrans.png" /></a>
           Search for?
           <input type="text" name="string" value="" size=40 maxlength=120 class="box" />
  • <input type="checkbox" name="engine" value="google-web" checked />Google Web
  • <input type="checkbox" name="engine" value="google-webuk" />Google Web UK
  • <input type="checkbox" name="engine" value="google-news" />Google News
  • <input type="checkbox" name="engine" value="google-groups" checked />Google Groups
  • <input type="checkbox" name="engine" value="yahoo-web" checked />Yahoo Web
  • <input type="checkbox" name="engine" value="yahoo-news" />Yahoo News
  • <input type="checkbox" name="engine" value="alltheweb" checked />All The Web
  • <input type="checkbox" name="engine" value="alltheweb-news" />All The Web News
  • <input type="checkbox" name="engine" value="msn" />MSN
  • <input type="checkbox" name="engine" value="ask-jeeves" />Ask Jeeves
  • <input type="checkbox" name="engine" value="lycos" />Lycos
  • <input type="checkbox" name="engine" value="hotbot" />Hotbot
  • <input type="checkbox" name="engine" value="wiki" />Wikipedia
  • <input type="checkbox" name="engine" value="thesaurus" />Thesaurus
  • <input type="checkbox" name="engine" value="dictionary" />Dictionary
  • <input type="checkbox" name="engine" value="" />
  • <input type="checkbox" name="engine" value="ebay" />eBay
  • <input type="checkbox" name="engine" value="ebay-uk" />eBay UK
  • <input type="checkbox" name="engine" value="amazon" />Amazon
  • <input type="checkbox" name="engine" value="amazon-uk" />Amazon UK
  • <input type="checkbox" name="engine" value="names" />Names
  • <input type="checkbox" name="engine" value="whois" />Whois
  • <input type="checkbox" name="engine" value="archive" />Archive
  • <input type="checkbox" name="engine" value="" />
<input type="submit" value="Search ticked engines now" id="submit" />

</body>

</html>

      </source>
   
  

<A href="http://www.wbex.ru/Code/JavaScriptDownload/tabsearch.zip">tabsearch.zip( 9 k)</a>


Search in different search engine

   <source lang="html4strict">

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head>

 <title>Search multiple engines</title>
 <link rel="shortcut icon" href="/images/favicon.ico" />
 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 <meta name="keywords" content="search,google,yahoo,alltheweb,ivar,abrahamsen">
 <meta name="description" content="search enginer page">
 <script language="JavaScript" type="text/javascript" src="/js/eray_core2.js"></script>
 <script language="JavaScript" type="text/javascript">
   function loader(){
     //coreFunc.reloader( 4000 );
   }
   function unloader(){
     //coreFunc.unload();
   }
   function changeAction( form, what ){
     form.action = what;
   }
 </script>
 
 <style type="text/css">
 body{
   font-family: Sans,  Arial;
   background-color:  #0018a5;
   color: white;
   margin: 0px;
 }
 table.border{
   border: 6px outset   silver;
   background-color: black;    
   margin: 0px;
 }  
 .cell{
   text-align: center;
   white-space: nowrap;
   padding: 0px 3px;
 }
 .head{
   font-weight: 900;
 }
 .section{
   font-weight: 600;
 }
 .txt{
   font-weight: 100;
 }
 .title{  
   font-size: 11pt;    
 }
 .domain{  
   font-size: 9pt;
 }
 .desc{    
   font-size: 8pt;
 }
 </style>

</head> <body onload="loader()" onunload="unloader()">

<a href="http://www.electricray.org" target="_top"><img border =0 height=20 src="/images/eraylogorayonlytrans.png" /></a>
           Search
<a href="http://www.electricray.org" target="_top"><img border =0 height=20 src="/images/eraylogorayonlytrans.png" /></a>
<form action="http://www.google.ru/search" method="get"> </form> <form action="http://search.yahoo.ru/search" method="get"> </form> <form action="http://www.alltheweb.ru/search" method="get"> </form> <form action="http://en.wikipedia.org/w/wiki.phtml" method="get"> </form> <form action="http://www.thesourus.ru/search" method="get"> </form> <form action="http://en.wikipedia.org/w/wiki.phtml" method="get"> </form> <form action="http://www.thesourus.ru/search" method="get"> </form> <form action="http://www.thesourus.ru/search" method="get"> </form> <form action="http://www.thesourus.ru/search" method="get"> </form> <form action="http://www.thesourus.ru/search" method="get"> </form> <form action="http://www.thesourus.ru/search" method="get"> </form>
               Google
               <input type="text" name="q"/>
Web:<input type="radio" checked name="type" onclick="changeAction(this.form,"http://www.google.ru/search")" /> Groups:<input type="radio" name="type"onclick="changeAction(this.form,"http://groups.google.ru/groups")" /> News:<input type="radio" name="type" onclick="changeAction(this.form,"http://news.google.ru/news")" />
               <input type="submit" value="Go" />
               Yahoo
               <input type="text" name="p" />
Web:<input type="radio" checked name="type" onclick="changeAction(this.form,"http://www.google.ru/search")" /> News:<input type="radio" name="type" onclick="changeAction(this.form,"http://news.search.yahoo.ru/search/news/")" />
               <input type="submit" value="Go" />
               All The Web
               <input type="text" name="q" />
Web:<input type="radio" checked name="cat"value="web" /> News:<input type="radio" name="cat" value="news" />
               <input type="submit" value="Go" />
               Ask Jeeves
               <input type="text" name="search" />
               <input type="submit" value="Go" />
               MSN
               <input type="text" />
               <input type="submit" value="Go" />
               Wikipedia
               <input type="text" name="search" />
               <input type="submit" value="Go" />
               Thesourus
               <input type="text" />
               <input type="submit" value="Go" />
               Dictionary
               <input type="text" />
               <input type="submit" value="Go" />
               Amazon
               <input type="text" />
               <input type="submit" value="Go" />
               eBay
               <input type="text" />
               <input type="submit" value="Go" />
               eBay
               <input type="text" />
               <input type="submit" value="Go" />

</body>

</html>

      </source>
   
  

<A href="http://www.wbex.ru/Code/JavaScriptDownload/tabsearch.zip">tabsearch.zip( 9 k)</a>