Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Blob in safari 5.1

Do safari browser for windows (version 5.1) support Blob?

The following sample code returns an error in console:

var array=[1,2];
var aBlob = new Blob( array);

Error:

"'[object BlobConstructor]' is not a constructor (evaluating 'new Blob( array)')"

How to fix this,If safari didn't support blob then how to replace this

like image 384
Venkat Avatar asked Mar 14 '16 12:03

Venkat


1 Answers

Nope. Based on https://developer.mozilla.org/en/docs/Web/API/Blob it is supported since Safari 6.

EDIT : obviously, MDN shows the way to use Blob without constructor:

var builder = new BlobBuilder();
var fileParts = ['<a id="a"><b id="b">hey!</b></a>'];
builder.append(fileParts[0]);
var myBlob = builder.getBlob('text/xml');
like image 81
Lpu8er Avatar answered Sep 23 '22 20:09

Lpu8er