javascript Global atob( ), btoa( )

atob( ), btoa( ) NN 4 IE n/a ECMA n/a  
atob("base64EncodedData") btoa("stringToBeEncoded")

These methods let you convert arbitrary strings (including strings conveying characters representing binary data and Unicode values) to a 65-character subset of the U.S.-ASCII character set. Encoding in this so-called base64 scheme allows any data to be conveyed along even the most rudimentary transport mechanism. You can read about the rationale and internal mechanisms of the encoding/decoding conversions in RFC 1521 of the Internet Engineering Task Force (http://www.ietf.org/rfc/rfc2045.txt).

 

Use the btoa( ) method to encode string data into the base64 scheme. The resulting encoded data will consist of ASCII characters a-z, A-Z, 0-9, and three symbols (/, +, =). Use the atob( ) method to decode base64 encoded data back to its original version.

 
Parameters
 
  • A string containing base64 data either encoded on the client or received as part of a document from a server that performs its own encoding.
  • A string characters to be encoded to base64 for internal or external use. For example, an encoded value could be assigned to the value property of an input element for submission to a server process designed to receive base64 data.
 
Returned Value

A string.


  • lenninfo
    #1
    2009-10-16
    [Quote]
    atob() and btoa() aren't run on ie6!
    Exist some tricks?
  • javascript manual
    #2
    2009-10-26
    [Quote]
    Yes, IE doesn't support this.
    See title:
    NN 4 IE n/a ECMA n/a
lenninfo
javascript manual

894,Nickname,Homepage or email,Comments here,Add comment