4

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.

3
  • 4
    ArrayBuffer isn't supported until IE10 (and I think this shows it: caniuse.com/typedarrays) Commented May 14, 2013 at 14:03
  • did u got the answer. If yes. can u post your answer over here Commented Jul 14, 2014 at 10:00
  • Hi, Apologies for the slow reply. I did not get a resolution at the time of my issue so just abandoned using the specific approach at that time. Hopefully you have been able to find a resolution since. Commented Aug 11, 2014 at 12:10

1 Answer 1

13

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.