Window btoa() method
- Forrige side blur()
- Næste side clearInterval()
- Gå tilbage til forrige niveau Window Objekt
Definition and Usage
btoa()
The method encodes the string in base-64.
btoa()
The method encodes the string using the characters "A-Z", "a-z", "0-9", "+", "/", and "=".
Tip:Use atob() method The method decodes base-64 encoded strings.
See also:
Example
Encode string in base-64:
let text = "Hello World!"; let encoded = window.btoa(text);
Syntax
window.btoa(string)
Parameter
Parameter | Beskrivelse |
---|---|
string | Required. The string to be encoded. |
Return value
Type | Beskrivelse |
---|---|
Streng | base-64 kodede strenge. |
Browserv understøttelse
Alle browsere understøtter btoa()
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | 10-11 | Support | Support | Support | Support |
- Forrige side blur()
- Næste side clearInterval()
- Gå tilbage til forrige niveau Window Objekt