- var loading = layer.load(0, {shade: [0.2,'#fff'] });
- xhr.open('POST', "XXX/downloadExport.do", true);
- xhr.responseType = 'blob';
- xhr.onload = function(e) {
- layer.close(loading);
- if (this.status == 200) {
- spread.resumePaint();
- var blob = this.response;
- excelIo.open(blob, function (json) {
- workbookObj = json;
- spread.fromJSON(workbookObj);
- spread.setActiveSheetIndex(0);
- spread.options.tabStripRatio = 0.7;
- spread.options.scroolbarMaxAlign=true;
- }, function (e) {
- console.log(e);
- layer.msg("文件加载异常");
- spread.clearSheets();
- var sheet = new GC.Spread.Sheets.Worksheet('New Sheet');
- spread.addSheet(0, sheet);
- }, {});
- }
- };
- xhr.send();
复制代码
这个问题出现在连续调用10次左右开始出现,不连续调用不会报错。另外在谷歌和edge上不报错。
|