Updated readme for the new Blob API

This commit is contained in:
Eli Grey
2013-01-23 22:07:46 -05:00
parent a1389f0299
commit 4de72365ac
+6 -7
View File
@@ -31,12 +31,11 @@ Examples
### Saving text ### Saving text
var bb = new BlobBuilder; var blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"});
bb.append("Hello, world!"); saveAs(blob, "hello world.txt");
saveAs(bb.getBlob("text/plain;charset=utf-8"), "hello world.txt");
The standard W3C File API [`BlobBuilder`][3] interface is not available in all browsers. The standard W3C File API [`Blob`][3] interface is not available in all browsers.
[BlobBuilder.js][4] is a cross-browser `BlobBuilder` implementation that solves this. [Blob.js][4] is a cross-browser `BlobBuilder` implementation that solves this.
### Saving a canvas ### Saving a canvas
@@ -65,6 +64,6 @@ This isn't that useful unless you're saving very large files (e.g. generated vid
[1]: http://www.w3.org/TR/file-writer-api/#the-filesaver-interface [1]: http://www.w3.org/TR/file-writer-api/#the-filesaver-interface
[2]: http://oftn.org/projects/FileSaver.js/demo/ [2]: http://oftn.org/projects/FileSaver.js/demo/
[3]: http://www.w3.org/TR/file-writer-api/#the-blobbuilder-interface [3]: https://developer.mozilla.org/en-US/docs/DOM/Blob
[4]: https://github.com/eligrey/BlobBuilder.js [4]: https://github.com/eligrey/Blob.js
[5]: https://github.com/eligrey/canvas-toBlob.js [5]: https://github.com/eligrey/canvas-toBlob.js