Internet Explorer Error : SCRIPT5009: ArrayBuffer is undefined

I am receiving an error in internet explorer 9 and under which does not occur on other browsers. It's:

SCRIPT5009: 'ArrayBuffer' is undefined

My code is as follows

    var rawLength = raw.length;
    var array = new Uint8Array(new ArrayBuffer(rawLength));
    for(i = 0; i < rawLength; i++) {
           array[i] = raw.charCodeAt(i);
            }

The line which breaks is var array = new Uint8Array(new ArrayBuffer(rawLength));

Does anyone know if there is a solution or workaround for this? I require my functionality to work in all browsers.

Answers


ArrayBuffer isn't supported until IE10 (and I think this shows it: http://caniuse.com/typedarrays).

You can use a polyfill, and here's one: https://github.com/inexorabletash/polyfill/blob/master/typedarray.js

Polyfill taken from: https://github.com/inexorabletash/polyfill


Need Your Help

How to obtain a pathname or dentry or struct file from a given inode?

linux-kernel kernel inode pathname

I need to know how to obtain a pathname or dentry or struct file from a given inode.

Representing files and lines in a file in model view?

asp.net-mvc oop viewmodel

I am trying to come up with a model design to solve the follwoing problem:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.