Results 1 to 5 of 5

Thread: Javascript Asc or Chr?

  1. #1

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935

    Javascript Asc or Chr?

    Do those VB functions exist in Javascript?

  2. #2

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    Is there a reference like the Javadocs in Java for Javascript? Maybe it's listed there.

  3. #3
    Lively Member
    Join Date
    Jul 2001
    Location
    USA
    Posts
    95
    <HTML>
    <HEAD>
    <script>
    for (i=1; i<=255; i++)
    document.write( i + ": " + String.fromCharCode(i) + "<br>")
    </script>
    <TITLE></TITLE>
    </HEAD>
    <BODY>
    </BODY>
    </HTML>

  4. #4

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    Cool, thanks.

  5. #5
    scoutt
    Guest
    a little something from the javascript guide
    Code:
    charAt 
    Method. Returns the character at the specified index.
    
    Syntax 
    stringName.charAt(index)
    Parameters 
    stringName is any string or a property of an existing object.
    index is any integer from zero to stringName.length - 1, or a 
    property of an existing object.
    
    Implemented in 
    Navigator 2.0
    
    Description 
    Characters in a string are indexed from left to right. 
    The index of the first character is zero, and the index
     of the last character is stringName.length - 1.
     If the index you supply is out of range, 
    JavaScript returns an empty string.
    
    Examples 
    The following example displays characters at different 
    locations in the string "Brave new world":
    
    var anyString="Brave new world"
    document.write("The character at index 0 is " + anyString.charAt(0))
    document.write("The character at index 1 is " + anyString.charAt(1))
    document.write("The character at index 2 is " + anyString.charAt(2))
    document.write("The character at index 3 is " + anyString.charAt(3))
    document.write("The character at index 4 is " + anyString.charAt(4))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width