2016-09-23 3 views
0

내가 IE11 던져 잘못된 상태 오류는

//Stream of data as res 
var dataView = new DataView(res); 
var blob = new Blob([dataView], {type: 'application/vnd.ms-excel'}); 

그러나 IE에서의 Blob

를 사용하여 엑셀을 저장하려면이 코드를에만 세 번째 줄, 그것은 완전히이다 잘못된 상태 오류를 던져 지원됨

답변

1

IE와 관련된 것으로 보입니다. 대신 생성자에서 Uint8Array을 사용할 수 있습니다.

var u8arr = new Uint8Array(dataView.buffer, dataView.byteOffset, dataView.byteLength); 

new Blob에 전달 된 배열의 모든 DataView 객체를 대체 할 함수를 작성 :

는이 DataView Uint8Array 동등한로 변환합니다. 또는 the polyfill here을 참조하십시오.