📜  js 保存文件 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:01.148000             🧑  作者: Mango

代码示例1
//javascript
function download(text, name, type) {
  var a = document.getElementById("a");
  var file = new Blob([text], {type: type});
  a.href = URL.createObjectURL(file);
  a.download = name;
}
//html
click here to download your file