Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/01/2007, 10:37
FlingeR
 
Fecha de Ingreso: enero-2007
Mensajes: 31
Antigüedad: 17 años, 3 meses
Puntos: 0
Desacuerdo buscador interno 2

arme este codigo, se supone q tiene q buscar la palabra "tonto" y tiene q reproducri un sonido pero no funciona, alguna idea ?

Código PHP:
<body>
<
meta http-equiv="refresh" content="5"/>
</
body>
<
html>
<
head>
<
script type="text/javascript">
function 
buscar() {
  
insulto 'tonto';
  
texto document.body.innerHTML;
  
patron = new RegExp('('+insulto+')','gi');
  
texto texto.replace(patron,'<span style="background:yellow">$1</span>');
  
document.body.innerHTML texto;
}

function 
Reproducir(){
  
document.all.sound.src "x.wav"}

if ( 
patron = new RegExp('('+insulto+')','gi') {
   function 
Reproducir()
}

</script>
</head>
<body onload="buscar()">
<p>Este código es un poco tonto</p>
<p>Pero más tonto hubiera sido no intentarlo</p>
</body>
</html>