我在 Internet Explorer 9 中收到一个错误,在其他浏览器中不会出现此错误。这是:
SCRIPT5009: 'ArrayBuffer' is undefined
我的代码如下
var rawLength = raw.length;
var array = new Uint8Array(new ArrayBuffer(rawLength));
for(i = 0; i < rawLength; i++) {
array[i] = raw.charCodeAt(i);
}
中断的行是 var array = new Uint8Array(new ArrayBuffer(rawLength));
有谁知道是否有解决方案或解决方法?我要求我的功能在所有浏览器中都能正常工作。
最佳答案
ArrayBuffer
在 IE10 之前不受支持(我认为这表明它:http://caniuse.com/typedarrays)。
您可以使用 polyfill,这是一个:https://github.com/inexorabletash/polyfill/blob/master/typedarray.js
Polyfill 取自:https://github.com/inexorabletash/polyfill
关于javascript - Internet Explorer 错误 : SCRIPT5009: ArrayBuffer is undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16545286/