Accès à plusieurs moteurs de recherche en une seule page

 

echerche sur une sélection de moteurs de votre choix.

Ainsi donc, vous inclurez le code suivant dans la section de votre page :


<script language="JavaScript">
function wordsplit(items)
{
var chartmp = "";
for (var i = 1 ; i <= items.length ; i++)
{
if (items.substring(i-1,i) == " ")
{
chartmp+="+";
}
else
{
chartmp+=items.substring(i-1,i);
}
}
return chartmp;
}

function search()
{
var motcle=document.Recherche.chainemot.value;
var yahoo;
var altavista;
var webcrawler;
var lycos;
var excite;

key=wordsplit(motcle);

if(document.Recherche.yahoo.checked)
{
yahoo=document.Recherche.yahoo.value;
yahoo+=key;

wind=window.open(yahoo,"newwindow1","width=700,height=200,scrollbars=yes");
}
if(document.Recherche.altavista.checked)
{
altavista = document.Recherche.altavista.value;
altavista+=key;

wind=window.open(altavista,"newwindow2","width=700,height=200,scrollbars=yes");
}
if(document.Recherche.webcrawler.checked)
{
webcrawler = document.Recherche.webcrawler.value;
webcrawler+=key;

wind=window.open(webcrawler,"newwindow3","width=700,height=200,scrollbars=yes");
}
if(document.Recherche.lycos.checked)
{
lycos = document.Recherche.lycos.value;
lycos+=key;

wind=window.open(lycos,"newwindow4","width=700,height=200,scrollbars=yes");
}
if(document.Recherche.excite.checked)
{
excite = document.Recherche.excite.value;
excite+=key;

wind=window.open(excite,"newwindow5","width=700,height=200,scrollbars=yes");
}
}
</SCRIPT>

Maintenant vous pouvez créer un formulaire de choix sur les différents moteurs de recherche :

<FORM NAME="Recherche">
Mot clé :
<INPUT TYPE="text" NAME="chainemot" SIZE=20>
<b>Choix du moteur :</b><br>

<INPUT TYPE="checkbox" NAME="webcrawler" VALUE="http://www.webcrawler.com/cgi-bin/WebQuery?searchText=">WebCrawler<br>
<INPUT TYPE="checkbox" NAME="excite" VALUE="http://www.excite.com/search.gw?trace=a&search=">Excite<br>
<INPUT TYPE="checkbox" NAME="lycos" VALUE="http://www.lycos.com/cgi-bin/pursuit?query=">Lycos<br>
<INPUT TYPE="checkbox" NAME="yahoo" VALUE="http://search.yahoo.com/search?p="> Yahoo<br>
<INPUT TYPE="checkbox" NAME="altavista" VALUE="http://www.altavista.digital.com/cgi-bin/query?pg=q&what=web&fmt=.&q=">Altavista<br>

<INPUT TYPE="button" VALUE="Go" onClick="search()">

</FORM>

Exemple de cette réalisation :

Mot clé :
Choix du moteur :

WebCrawler

Excite

Lycos

Yahoo

Altavista

Fanch

No related posts.

Les commentaires sont fermés.