Bueno, lo que me gustaría saber es que hay que poner de código en una página, o que hay que hacer para añadir un buscador que busque dentro de mi página, por una palabra y que luego salga un listado de ellas.
Gracias a todos

| ||||
Re: Buscador en mi página ¿Es esto lo que buscas? Es un código que encontré por ahí.
Código:
Cambia los mensajes de alerta a tu gusto. <!-- Copiar dentro del tag BODY --> <script language="JavaScript"> // By Mike Hall ([email protected]) 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; // Find next occurance of the given string on the page, wrap around to the // start of the page if necessary. if (NS4) { // Look for match starting at the current point. If not found, rewind // back to the first match. if (!win.find(str)) while(win.find(str, false, true)) n++; else n++; // If not found in either direction, give message. if (n == 0) alert("Not found."); } if (IE4) { txt = win.document.body.createTextRange(); // Find the nth match from the top of the page. for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) { txt.moveStart("character", 1); txt.moveEnd("textedit"); } // If found, mark it and scroll it into view. if (found) { txt.moveStart("character", -1); txt.findText(str); txt.select(); txt.scrollIntoView(); n++; } // Otherwise, start over at the top of the page and find first match. else { if (n > 0) { n = 0; findInPage(str); } // Not found anywhere, give message. else alert("Not found."); } } return false; } </script> <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 type="submit" value="Buscar"> </p> </form> <hr> Saludos de Ferny. "En teoría no hay diferencia entre teoría y práctica, pero en la práctica sí la hay" Mira mi página de DivX <a href="http://club.telepolis.com/dvd_a_video_avi/index.htm">http://club.telepolis.com/dvd_a_video_avi/index.htm</a> |
| ||||
Re: Buscador en mi página Ah, se me olvidó decirte que esto sólo busca en la página donde esté el código. Es bueno si tienes un listado enorme de cosas y quieres buscar una. Si lo que quieres es buscar en cualquier página de tu web te recomiendo el servicio de <a href='ir.asp?http://www.freefind.com' target='_blank'>http://www.freefind.com...</a> que es gratis y muy bueno. <hr> Saludos de Ferny. "En teoría no hay diferencia entre teoría y práctica, pero en la práctica sí la hay" Mira mi página de DivX <a href="http://club.telepolis.com/dvd_a_video_avi/index.htm">http://club.telepolis.com/dvd_a_video_avi/index.htm</a> |
| ||||
Re: Buscador en mi página No, no me refería a eso (tu primer mensaje, voy a ver la página que me has dicho) porque es como el "Buscar en esta página" del mismo Explorer, mi idea era buscar en TODA la página y sacar otra página de resultados. Gracias de todas formas. Visita <A HREF="http://www.grandprixformula1.com">www.grandprixformula1.c om</A><BR><BR><B>CNL</B> |
| ||||
Re: Buscador en mi página No, tampoco me sirve la URL que me has dado... es un poco lioso y no me gusta mucho, aparte de que me gustaría "controlarlo" más, poniendo yo mismo el código. Visita <A HREF="http://www.grandprixformula1.com">www.grandprixformula1.c om</A><BR><BR><B>CNL</B> |