问题描述
我在Internet Explorer 9和下收到错误在其他浏览器不会发生。它是:
I am receiving an error in internet explorer 9 and under which does not occur on other browsers. It's:
SCRIPT5009:ArrayBuffer未定义
我的code是如下:
var rawLength = raw.length;
var array = new Uint8Array(new ArrayBuffer(rawLength));
for(i = 0; i < rawLength; i++) {
array[i] = raw.charCodeAt(i);
}
打破是 VAR阵列=新Uint8Array(新ArrayBuffer(rawLength))线;
有谁知道是否有一个解决方案或解决方法吗?我要求我的功能在所有的浏览器。
Does anyone know if there is a solution or workaround for this? I require my functionality to work in all browsers.
推荐答案
ArrayBuffer
之前,不支持IE10(我认为这显示了它:的)。
ArrayBuffer
isn't supported until IE10 (and I think this shows it: http://caniuse.com/typedarrays).
您可以用填充工具,并且这里有一个:https://github.com/inexorabletash/polyfill/blob/master/typedarray.js
You can use a polyfill, and here's one: https://github.com/inexorabletash/polyfill/blob/master/typedarray.js
摘自填充工具:
这篇关于Internet Explorer错误:SCRIPT5009:ArrayBuffer是未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!