I read lot of sample to generate csv file from data and push it to download to export it.
let csvContent = '';
$.each(msg.d.LstObj[0], function (key, element) { csvContent += (csvContent === '' ? '' : ',') + key; });
csvContent += "
";
msg.d.LstObj.forEach(function (rowArray) {
var row = '';
$.each(rowArray, function (key, element) { row += (row === '' ? '' : ',') + element; });
csvContent += row + "
";
});
var hiddenElement = document.createElement('a');
hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(csvContent);
hiddenElement.target = '_blank';
hiddenElement.download = 'people.csv';
hiddenElement.click();
Under Chrome FF : ok
Under IE11 : no download just a message ask me :
voulez vous autoriser ce site web à ouvrir une application
And just one choise windows store...
Someone have an idea??? I put my code in "site de confiance"...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…