Ver Mensaje Individual
  #3 (permalink)  
Antiguo 27/03/2006, 13:58
dj_nachos
 
Fecha de Ingreso: marzo-2006
Mensajes: 2
Antigüedad: 18 años, 1 mes
Puntos: 0
hola que tal gracias por tu ayuda, también e oido acerca de ajax pero todavía estoy un poco novato con ese lenguaje.

Por fin logre realizar el buscador...Gracias a un Ebook que encontre de Javascript y funciona de maravilla aki les coloco el codigo de la función que busca el nombre que introduces en un input text y lo busca en la pag....

Gracias y Saludos....

---->
<script language="JavaScript">

var NS4 = (document.layers);
var IE4 = (document.all);

var win = window; // Con frames usar top.nombre.window;
var n = 0;

function findInPage(str) {

var txt, i, found;

if (str == "")
return false;

if (NS4) {

if (!win.find(str))
while(win.find(str, false, true))
n++;
else
n++;

if (n == 0)
alert("Not found.");
}

if (IE4) {
txt = win.document.body.createTextRange();

for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
txt.moveStart("character", 1);
txt.moveEnd("textedit");
}

if (found) {
txt.moveStart("character", -1);
txt.findText(str);
txt.select();
txt.scrollIntoView();
n++;
}

else {
if (n > 0) {
n = 0;
findInPage(str);
}

else
alert("No se encuentra en la Lista");
}
}

return false;
}</script>

---> luego en tu <body> lo siguiente-->
<form name="search" onSubmit="return findInPage(this.string.value);"><font size="2"><p></font><font size="3">
<input name="string" type="text" size="15"
onChange="n = 0;">
</font>
<input name="submit2" type="submit" value="Buscar"><p><p></p></font><font color="#FFFFFF">

--->

espero que les sea util !!!!