maynard88 / ExportToExcel

jQuery Client Side Excel Export Plugin Library
19 stars 6 forks source link

Download IE11 #1

Open raszagar opened 6 years ago

raszagar commented 6 years ago

I used this function (Autor: Ludovic Feltz), in place of iframe hide, it download file with download of IE:

function downloadExcelExport(filename, data) { var blob = new Blob(["\ufeff", data], {type: 'application/vnd.ms-excel;charset=' + $defaults.encoding}); if(window.navigator.msSaveOrOpenBlob) { window.navigator.msSaveBlob(blob, filename); } else { var elem = window.document.createElement('a'); elem.href = window.URL.createObjectURL(blob); elem.download = filename; document.body.appendChild(elem); elem.click(); document.body.removeChild(elem); } }

In exportToExcelIE function: ... downloadExcelExport('excel.xls', tab_text); return (sa);