Blob : Object
URL.createObjectURL()
to generate a url, and pass that url to HTMLImageElement.src
to display the image you created without talking to a server.Constructors
Creates a new Blob
. The elements of blobParts
must be of the types ArrayBuffer
, ArrayBufferView
, Blob
, or String
. If ending
is set to 'native'
, the line endings in the blob will be converted to the system line endings, such as '\r\n'
for Windows or '\n'
for Mac.
Example:
RunResults:
Instance Methods
Asynchronously returns an ArrayBuffer for the data in this
. See also FileReader.readAsArrayBuffer().
Example:
RunResults:
Returns a new blob that contains the bytes start
to end - 1
from this
. If start
or end
is negative, the value is added to this.size
before performing the slice. If end
is not specified, this.size
is used. The returned blob's type
will be contentType
if specified, otherwise it will be ''
.
Example:
RunResults:
Returns a stream of the data in this
. The values of the stream will be Uint8Array
s.
Example:
RunResults:
Asynchronously returns a String for the data in this
. See also FileReader.readAsText().