Foros del Web » Programando para Internet » Javascript »

Java Script que solo funciona en Explorer

Estas en el tema de Java Script que solo funciona en Explorer en el foro de Javascript en Foros del Web. Estuve viendo otros temas pero no encontre nada que me ayude. Es un simple script de busque de texto que conseguí y me funciona bien ...
  #1 (permalink)  
Antiguo 27/02/2013, 13:59
 
Fecha de Ingreso: octubre-2009
Mensajes: 2
Antigüedad: 14 años, 6 meses
Puntos: 0
Java Script que solo funciona en Explorer

Estuve viendo otros temas pero no encontre nada que me ayude.
Es un simple script de busque de texto que conseguí y me funciona bien salvo que no anda en ningun otro navegador que no se Explorer.
El codigo es viejo dice (IE 4) y no se si se puede modificar para que funcione en los demas navegadores.

<body>
<!-- Copiar dentro del tag BODY -->

<script language="JavaScript">
// By Mike Hall
var N = (document.layers);
var I = (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 (N) {
// 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 (I) {
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>



Bibliografía y links consultados.

Filme “El Ciudadano Kane” (Orson Welles-1941).

Adorno, T.W., Horkheimer, M., “Odiseo o mito e ilustración en Dialéctica de la ilustración”.

Nietzsche, Friedrich, Más allá del bien y del mal.

Foucault, Michel, “El panóptico” en Vigilar y Castigar (nacimiento de la prisión).

Francisco Zudiaur “Historia del cine”.

José E Burucúa “Historia y ambivalencia: ensayos sobre arte”

Blog sobre cine “39 escalones” Reflexiones desde un rollo de celuloide.

http://39escalones.wordpress.com/2008/06/24/mis-escenas-favoritas-ciudadano-kane/La ilustración.

Blog sobre las Características generales de la ilustración.

http://thales.cica.es/rd/Recursos/rd99/ed99-0314-01/ilustra.htm

Blog sobre “La guerra de los mundos” de Orson Welles.

http://astroariel.blogspot.com.ar/2007/05/orson-welles-la-guerra-de-los-mundos-y.html

Blog de profesor Alexis Márquez Rodríguez sobre el despotismo.

http://ar.groups.yahoo.com/group/quijote/message/25727

Página Web Cinemateca Kairos Gobierno de España Ministerio de educación.

http://iris.cnice.mec.es/kairos/mediateca/cinemateca/perspectivas/perspectivas03.html

Sánchez Noriega, José Luís “Historia del Cine” Madrid, Alianza, 2002

</body>

Etiquetas: explorer, funcion, html, input, java, select
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:32.