function saveSqlToLocal() {
var textToSave = sqlEditor.getValue();
var textToSaveAsBlob = new Blob([textToSave], { type: "text/plain" });
var textToSaveAsUrl = window.URL.createObjectURL(textToSaveAsBlob);
var downloadLink = document.createElement("a");
downloadLink.download ="文件名";
downloadLink.href = textToSaveAsUrl;
downloadLink.onclick = destroyClickedElement;
downloadLink.style.display = "none";
document.body.appendChild(downloadLink);
downloadLink.click();
};~~~
网友评论