August 1999
Intermediate to advanced
1488 pages
72h 53m
English
string.charCodeAt(num)
The charCodeAt() method of an instance of the String object returns the ISO-Latin-1 number of the character located at the indexed, num, position passed. This indexing is done from left to right starting with the 0 (zero) position. If the num passed is not a valid index in the string, –1 is returned.
Listing 6.234 creates an instance of a String object. When the page is loaded, the user is then prompted for an index number. After entering the index number and OK, the ISO-Latin-1 number of the character at that indexed location is written to the document. Notice that there is also a check to see ...
Read now
Unlock full access