Tema: codigo ascii
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/07/2009, 17:36
hola123
 
Fecha de Ingreso: febrero-2009
Mensajes: 142
Antigüedad: 15 años, 3 meses
Puntos: 0
Exclamación codigo ascii

que tal nuevamente

Estoy haciendo un script que recoge una cadena de caracteres y la quiero convertir en ascii, pero no me manda el cosigo ascii, solo lee letra por letra hasta ahorita tengo esto:

function cript(){

a=frmlogon.txtusuario.value;
pass =frmlogon.txtcontrasena.value;
//NOS ASEGURAMOS QUE LA CADENA DE USUARIO SEA DE 10 CARACTERES
b= a.substring(0,10);
p= pass.substring(0,10);

var txt=new Array();


for(var r=1;r<=b.length;r++){
q = r - 1;
txt[q] =b.substring(q,r);
}

// alert("usuaripo" + txt[0] + txt[1]+ txt[2] +txt[3] +txt[4] +txt[5]+txt[6]+txt[7]) ;
for(var r=1;r<=p.length;r++){
q = r - 1;
txt[q] =p.substring(q,r);
}
//alert("pass" + txt[0] + txt[1]+ txt[2] +txt[3] +txt[4] +txt[5]+txt[6]+txt[7]) ;

var asc=new Array();

for(var q=0;q<=b.length;q++){
String.fromCharCode(asc[q]);
alert(q);
alert(asc[q]);
}
}
Espero que ayuden gracias