Update article.md

This commit is contained in:
LeviDing 2020-04-09 11:29:51 +08:00 committed by GitHub
parent c89ddc5d92
commit ec9c76c6be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,8 +61,8 @@ The main methods:
The choice of `read*` method depends on which format we prefer, how we're going to use the data.
- `readAsArrayBuffer` - for binary files, to do low-level binary operations. For high-level operations, like slicing, `File` inherits from `Blob`, so we can call them directly, without reading.
- `readAsText` - for text files, when we'd like to get a string.
- `readAsArrayBuffer` -- for binary files, to do low-level binary operations. For high-level operations, like slicing, `File` inherits from `Blob`, so we can call them directly, without reading.
- `readAsText` -- for text files, when we'd like to get a string.
- `readAsDataURL` -- when we'd like to use this data in `src` for `img` or another tag. There's an alternative to reading a file for that, as discussed in chapter <info:blob>: `URL.createObjectURL(file)`.
As the reading proceeds, there are events: