我编写了这个导出按钮,它基本上将我在 google 表上的所有数据都吐出到 CSV 中以供下载。它工作得非常好,直到我有太多行,当我尝试下载 csv 时,Chrome 给了我“aw snap”错误页面。我该如何解决?
var csvContent = "data:text/csv;charset=utf-8,";
data.forEach(function (infoArray, index) {
dataString = infoArray.join(",");
csvContent += dataString + "\n";
});
var encodedUri = encodeURI(csvContent);
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", "Data.csv");
link.click();