function(url,name){
let a = document.createElement("a");
a.id = 'idName';
a.download = name + ".xls"; // firefox中必须加后缀
a.href = url; // url在这里指路径
document.body.append(a); // 修复firefox中无法触发click
a.click();
document.getElementById('idName').remove();
}
网友评论