📜  js 在 blob 中运行 html - Javascript 代码示例

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

代码示例1
var val = "
abc
"; var file = new Blob([val], { type: "text/html" }); // file object reference var download = URL.createObjectURL(file); var a = document.createElement("a"); a.href = download; a.download = "file-" + new Date().getTime(); document.body.appendChild(a); a.click()