safari - Blob constructor

I am using the below code to open a local text file.It works fine in firefox but in safari i get the error as '[object BlobConstructor]' is not a constructor (evaluating 'new Blob([xhr.response])').please help me by providing links.

 var xhr = new XMLHttpRequest(),blob;'GET', 'example.txt');
xhr.responseType = 'arraybuffer';
xhr.onload = function(e) {
blob = new Blob([xhr.response]);


1 Answer

  1. Laurent- Reply


    It's a bug in the older Safari/WebKits. Upgrade your browser or operating system.

    Note: It still does not appear to accept ArrayBufferView's as arguments, but should be fine for normal arrays.

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>