📜  保存东西 javascript 代码示例

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

代码示例1
let a = document.createElement('a');
a.href = "data:application/octet-stream,"+encodeURIComponent('"My DATA"');
a.download = 'myFile.json';
a.click(); // we not add 'a' to DOM so no need to remove