Ver Mensaje Individual
  #3 (permalink)  
Antiguo 06/12/2005, 19:02
leirad
 
Fecha de Ingreso: diciembre-2005
Mensajes: 3
Antigüedad: 19 años, 3 meses
Puntos: 0
<html>
<head>
<script language="javascript">



function contarPal()
{
var a = this.f1.t1.value;
var value=a.split(' ').length;
var salida;
var aux;
var pos =0;
var ora=new Array()

for(i=0;i<value;i++)
{
for(j=pos;j<a.length;j++)
{
if((a.charAt(j)==" ")||(a.charAt(j)=="."))
{
ora[i]=a.substring(pos,j)

pos=j+1
break
}
}
}
////Abrir una nueva ventana con los datos.///
MiVentana=open("","MiPropiaVentana","toolbar=no,di rectories=no,menubar=no,status=yes");
MiVentana.document.write('<body><p>Cantidad de Palabras</p><input name="Edit4" type="text" id="Edit4" size="60"></body></br>')
MiVentana.document.getElementById("Edit4").value=v alue;
MiVentana.document.write('<body><p>Texto Invertido</p><input name="Edit2" type="text" id="Edit2" size="60"></body></br>')
MiVentana.document.getElementById("Edit2").value=o ra.reverse();
MiVentana.document.write('<body><p>Texto Organizado</p><input name="Edit3" type="text" id="Edit3" size="60"></body></br>')
MiVentana.document.getElementById("Edit3").value=o ra.sort();

}





</script>
</head>

<body>

<form name="f1">

<i><b>Su oracion debe terminar en punto</b></i></br></br>

<input type="text" name="t1" size="40"></br></br>

<input type="button" value="Mostrar" onClick="contarPal()">


</form>

</body>
</html>