JavaScript DHTML/Ajax Layer/Search Engine
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 :
- /
- wrapper{
}
- wrapper > tr > td {
text-align: center;
}
- main{
border: 3px outset silver; background-color: #99ccff;
}
- main > tr > td{
padding: 5px; font: bold 10pt "Comic Sans", Sans, Tahoma; text-align: center;
}
- main td{
padding: 5px;
}
- main .logo{
width: 20px;
}
- main td#title{
font-size: 18pt; text-align: center; /*width: 100%;*/
}
- main #searches {
}
- main #searches td{
white-space: nowrap;
}
- main #searches ul{
}
- main #searches li{
list-style: none;
}
- main td#submit{
text-align: center;
}
- 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()">
|
</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()">
|
</body>
</html>
</source>
<A href="http://www.wbex.ru/Code/JavaScriptDownload/tabsearch.zip">tabsearch.zip( 9 k)</a>