Blob()
constructor returns a new
Blob
object. The content of the blob consists of the concatenation of the values given in the parameter
array
.
var newBlob = new Blob(array, options);
array
数组
of
ArrayBuffer
,
ArrayBufferView
,
Blob
,
USVString
objects, or a mix of any of such objects, that will be put inside the
Blob
.
USVString
objects are encoded as UTF-8.
选项
可选
An optional object of type
BlobPropertyBag
which may specify any of the following properties:
type
可选
""
).
endings
可选
\n
) within the contents, if the data is text. The default value,
transparent
, copies newline characters into the blob without changing them. To convert newlines to the host system's native convention, specify the value
native
.
新的
Blob
object containing the specified data.
var aFileParts = ['<a id="a"><b id="b">hey!</b></a>']; // an array consisting of a single DOMString
var oMyBlob = new Blob(aFileParts, {type : 'text/html'}); // the blob
| 规范 | 状态 | 注释 |
|---|---|---|
|
文件 API
The definition of 'Blob()' in that specification. |
工作草案 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
Blob()
构造函数
|
Chrome 20 | Edge 12 |
Firefox
13
|
IE 10 | Opera 12 | Safari 8 | WebView Android 37 | Chrome Android 25 |
Firefox Android
14
|
Opera Android 12 | Safari iOS 8 | Samsung Internet Android 1.5 |
完整支持
见实现注意事项。
BlobBuilder
interface which this constructor replaces.
Blob
Blob()