Tema: Help !
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 03/03/2002, 05:28
Avatar de ||Dj||
||Dj||
 
Fecha de Ingreso: enero-2002
Mensajes: 2.349
Antigüedad: 23 años
Puntos: 1
Re: Help !

<!-- Begin
var item = new Array();

c=0; item[c]=new Array("index.php","","Dem oSite","index,main,start,home,front&quot ;,"Demonstration search engine data about an imagined but probable internet site.");

page="<html><head><title>Re sultados de la búsqueda</title></head><body bgcolor='white'><center><table border=0 cellspacing=10 width=80%>";


function search(frm) {
win = window.open("","","scroll bars, WIDTH=340,HEIGHT=225");
win.document.write(page);
txt = frm.srchval.value.split(" ");
fnd = new Array(); total=0;
for (i = 0; i < item.length; i++) {
fnd[I] = 0; order = new Array(0, 4, 2, 3);
for (j = 0; j < order.length; j++)
for (k = 0; k < txt.length; k++)
if (item[i][order[j]].toLowerCase().indexOf(txt[k]) > -1 && txt[k] != "")
fnd += (j+1);
}
for (i = 0; i < fnd.length; i++) {
n = 0; w = -1;
for (j = 0;j < fnd.length; j++)
if (fnd[j] > n) { n = fnd[j]; w = j; };
if (w > -1) total += show(w, win, n);
fnd[w] = 0;
}
win.document.write("</table><br>Documentos encontrados: "+total+"<br></body></html>");
win.document.close();
}
function show(which,wind,num) {
link = item[which][1] + item[which][0];
line = "<tr><td><a href='"+link+"'>"+item[which][2]+"</a> Score: "+num+"<br>";
line += item[which][4] + "<br>"+link+"</td></tr>";
wind.document.write(line);
return 1;
}
// End -->