View Single Post
  #15 (permalink)  
Old Sep 21st, 2006, 11:15
spinal007's Avatar
spinal007 spinal007 is offline
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 23
Posts: 1,650
Blog Entries: 1
Thanks: 0
Thanked 4 Times in 4 Posts
Re: Urgent Javascript Help

Right, I don't mean to confuse anyone BUT...
"a".charCodeAt(0) returns 97
"a".charCodeAt(0)-96 returns 1
that's the encryption problem solved...

charCodeAt is the quickest way to retrieve the character code AND can also be used for validation:
if(char.charCodeAt(0)>=65 && char.charCodeAt(0)<=122){
// do the thing
}
there's no need for long string constants OR regular expressions.

then all you need is to build a decent interface, which you guys seems to be doing.



This might be usefull:
www.lookuptables.com - ASCII Table
Reply With Quote