javascript ie9 错误:'Blob' 未定义

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23830134/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 01:38:29  来源:igfitidea点击:

ie9 Error: 'Blob' is undefined

javascriptcsvkendo-uiinternet-explorer-9blob

提问by user3641778

this http://jsfiddle.net/bCRm3/17/

这个http://jsfiddle.net/bCRm3/17/

(Kendo grid export to csv)

(剑道网格导出到csv)

works fine in firefox, chrome and IE11

在 Firefox、Chrome 和 IE11 中工作正常

in ie9 im getting

在 ie9 中

            blob = new Blob([csv], { type: 'text/csv;charset=utf-8' }); //Blob.js
            saveAs(blob, fileName); //FileSaver.js

'Blob' is undefined show, line 141 character 17

'Blob' 未定义显示,第 141 行字符 17

is there a way around this for ie9? (im not sure if this works on ie10)

ie9有没有办法解决这个问题?(我不确定这是否适用于 ie10)

回答by Dalorzo

Check Blobobject browser compatibility:

检查Blob对象浏览器兼容性:

Browser compatibility

浏览器兼容性

Chrome  Firefox (Gecko) Internet Explorer   Opera   Safari (WebKit)
20      13.0 (13.0)     10                  12.10   6 (536.10)
Chrome  Firefox (Gecko) Internet Explorer   Opera   Safari (WebKit)
20      13.0 (13.0)     10                  12.10   6 (536.10)

Please note that this is not supported by all browsers including IE9 or ealier:

请注意,并非所有浏览器(包括 IE9 或更高版本)都支持此功能:

https://developer.mozilla.org/en-US/docs/Web/API/Blob

https://developer.mozilla.org/en-US/docs/Web/API/Blob