直接复制就可以用了(下面标红地方是需要修改的地方)
普通:
<head>
<title>test111</title>
</head>
<body>
<button id="save" type="button" onClick="saveFile()">保存</button>
</body>
<script>
function fakeClick(obj) {
var ev = document.createEvent("MouseEvents");
ev.initMouseEvent("click", true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
obj.dispatchEvent(ev);
}
function exportRaw(name, data) {
var urlObject = window.URL || window.webkitURL || window;
var export_blob = new Blob([data]);
var save_link = document.createElementNS("http://www.w3.org/1999/xhtm