Fix typos in 4.3 (Blob)
This commit is contained in:
parent
6ec4c4fc99
commit
91da65d1d3
1 changed files with 3 additions and 3 deletions
|
@ -55,7 +55,7 @@ This behavior is similar to JavaScript strings: we can't change a character in a
|
|||
|
||||
## Blob as URL
|
||||
|
||||
A Blob can be easily used as an URL for `<a>`, `<img>` or other tags, to show its contents.
|
||||
A Blob can be easily used as a URL for `<a>`, `<img>` or other tags, to show its contents.
|
||||
|
||||
Thanks to `type`, we can also download/upload `Blob` objects, and the `type` naturally becomes `Content-Type` in network requests.
|
||||
|
||||
|
@ -99,7 +99,7 @@ blob:https://javascript.info/1e67e00e-860d-40a5-89ae-6ab0cbee6273
|
|||
|
||||
For each URL generated by `URL.createObjectURL` the browser stores a URL -> `Blob` mapping internally. So such URLs are short, but allow to access the `Blob`.
|
||||
|
||||
A generated URL (and hence the link with it) is only valid within the current document, while it's open. And it allows to reference the `Blob` in `<img>`, `<a>`, basically any other object that expects an url.
|
||||
A generated URL (and hence the link with it) is only valid within the current document, while it's open. And it allows to reference the `Blob` in `<img>`, `<a>`, basically any other object that expects a URL.
|
||||
|
||||
There's a side-effect though. While there's a mapping for a `Blob`, the `Blob` itself resides in the memory. The browser can't free it.
|
||||
|
||||
|
@ -151,7 +151,7 @@ reader.onload = function() {
|
|||
};
|
||||
```
|
||||
|
||||
Both ways of making an URL of a `Blob` are usable. But usually `URL.createObjectURL(blob)` is simpler and faster.
|
||||
Both ways of making a URL of a `Blob` are usable. But usually `URL.createObjectURL(blob)` is simpler and faster.
|
||||
|
||||
```compare title-plus="URL.createObjectURL(blob)" title-minus="Blob to data url"
|
||||
+ We need to revoke them if care about memory.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue